vincecodegreeen
New Member
- Joined
- Jan 17, 2014
- Messages
- 39
I am learning VBA for excel. I have need to add hyperlinks to a series of some 4000 cells.Each is based on a identical cell pattern in sequential worksheets. So far I have tried the following:
Range("B2").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:="", SubAddress:= _
"Max tree base'!P2", TextToDisplay:="Max tree base'!P2"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:="", SubAddress:= _
"'Max tree base'!H3", TextToDisplay:="'Max tree base'!H3"
Range("B4").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:="", SubAddress:= _
"'Max tree base'!X3", TextToDisplay:="'Max tree base'!X3"
The sheet names need to be replaced with the output from For Each worksheet in the workbook (about 260) and the cell address with a consistent pattern of 15 cells in each sheet. I have an array of the cell addresses to apply to each worksheet as the code works through the list. How do I reference and insert those variables into the appropriate place.
I may be working this backwards and could use any insight you might suggest.
Thanks,
Vince
Range("B2").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:="", SubAddress:= _
"Max tree base'!P2", TextToDisplay:="Max tree base'!P2"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:="", SubAddress:= _
"'Max tree base'!H3", TextToDisplay:="'Max tree base'!H3"
Range("B4").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:="", SubAddress:= _
"'Max tree base'!X3", TextToDisplay:="'Max tree base'!X3"
The sheet names need to be replaced with the output from For Each worksheet in the workbook (about 260) and the cell address with a consistent pattern of 15 cells in each sheet. I have an array of the cell addresses to apply to each worksheet as the code works through the list. How do I reference and insert those variables into the appropriate place.
I may be working this backwards and could use any insight you might suggest.
Thanks,
Vince