VBA to Replace HyperLinks - Head Hurts Terribly

VenturSum

Board Regular
Joined
May 23, 2010
Messages
137
Guys & Gals..

My project requires me to replace hyperlinks in a file.

And I'm can't seem to get the new data back into Excel

I've extracted the code and my result table looks like:
Worksheet index | Hyperlink Number | Address | TextToDisplay

I don't want to ADD the hyperlink.
I just want to replace the value

This code does NOT Work:
Worksheets(WSIndx).Hyperlinks(HLIndx).Item.Address = "'" & ws.Cells(j, 7)
Worksheets(WSIndx).Hyperlinks(HLIndx).Item.TextToDisplay = ws.Cells(j, 9)

I believe my sytax is wrong.
I believe pound signs are needed #, just don't know how.
I can't find reference.

ANY Help Would be appreciated.

John,
In Annapolis.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I highly doubt there will be pound signs involved.

What are you trying to replace the hyperlinks with?
 
Upvote 0
Thanks,

I got it to work...
Here's the code..

Code:
     With Worksheets(WSIndx).Hyperlinks(HLIndx)
          '.Anchor =
           .SubAddress = "'" & ws.Cells(j, 12)
           .TextToDisplay = ws.Cells(j, 9)
           .Name = ws.Cells(j, 7)
           .Range = ws.Cells(j, 14)
    End With
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top