BrendanDixon
Board Regular
- Joined
- Mar 7, 2010
- Messages
- 174
- Office Version
- 365
- 2019
- Platform
- Windows
Hi all I have
200 cells that I want to add hyperlinks to different sheet. I am trying to run a loop where I can fill in these automatically....
basically I want Cell E203 to hyperlink to sheet 201!A1
Cell E204 to hyperlink to sheet 202!A1
Cell E205 to hyperlink to sheet 203!A1 etc
all the way to 400. This is what I have written so far but it comes up with an error and I do not know the syntax to do the range with a counting number
200 cells that I want to add hyperlinks to different sheet. I am trying to run a loop where I can fill in these automatically....
basically I want Cell E203 to hyperlink to sheet 201!A1
Cell E204 to hyperlink to sheet 202!A1
Cell E205 to hyperlink to sheet 203!A1 etc
all the way to 400. This is what I have written so far but it comes up with an error and I do not know the syntax to do the range with a counting number
Code:
Sub test()
Dim i As Long, Got As Boolean
For i = 202 To 400
Range(E(i)).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'(i-2)'!A1", TextToDisplay:="View"
Next i
End Sub