I'm trying to change the year from 03 to 04 in my hyperlinks, and I'm still getting a mismatch error when I get to this line:
Quote.Range = wsF.Substitute(.Range, strOld, strNew)
I'm trying to change the year from 03 to 04 in my hyperlinks, and I'm still getting a mismatch error when I get to this line:
Quote.Range = wsF.Substitute(.Range, strOld, strNew)
I'd say copy and paste this code (he changed a little bit of it) into a new module w/in the workbook you want to change the 03's.. then run the "swaptext" macro, I was having the same probs as you before but mine now works fine...
Sub SwapText()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Dec 03") 'change this "Dec 03" to your [i] worksheet [/i] name
HyperlinkChanger ws, "03", "04"
End Sub
End Sub
Sub HyperlinkChanger(ws As Worksheet, strOld As String, strNew As String)
Dim hLink As Hyperlink, wsF As WorksheetFunction
Set wsF = Application.WorksheetFunction
For Each hLink In ws.Hyperlinks
With hLink
.Range = wsF.Substitute(.Range, strOld, strNew)
.Address = ""
.SubAddress = wsF.Substitute(.SubAddress, strOld, strNew)
End With
Next hLink
End Sub
Display More
Nah, still nothin. I'm wondering if the code that I pasted in is expecting the fields to be strings instead of what they are set to know which is currency.
well if it's reading the hyperlink i don't see why it'd matter.. do u want to email me the file and i can check it out?? not sure how much luck i'll have but i'll give it a shot..
[email protected]
lata
Don’t have an account yet? Register yourself now and be a part of our community!