Change Hyperlink Subaddress in Specified Range
Question posted by: Bertha94
(Newbie)
on
July 24th, 2008 03:53 PM
Hi,
I have a macro that adds a row on my summary page, then adds a worksheet where the detail data will be entered for that row. I add the row by copying the row above it and inserting below. The only things i need to change are the subaddresses of all the hyperlinks that were copied down. My problem is that when I change the subaddress for the new row, it always changes the subaddresses of the row(s) above (or any other row with the same subaddress as the new row) even though I am only calling out that range. Here is my code:
Range("G" & CO_Total_Row - 1 & ":" & "AQ" & CO_Total_Row - 1).Select
Dim Old_Hyperlink_Address As String
Old_Hyperlink_Address = "'CO" & Num_COs - 1 & "'!C1"
Dim New_Hyperlink_Address As String
New_Hyperlink_Address = "'CO" & Num_COs + 1 & "'!C1"
Dim hLink As Hyperlink
For Each hLink In Selection.Hyperlinks
hLink.SubAddress = New_Hyperlink_Address
Next hLink
Anyone have an idea why this doesn't work correctly?
 |
Not the answer you were looking for? Post your question . . .
190,074 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|
|
|
Latest Articles: Read & Comment
Top Visual Basic Forum Contributors
|