vzachin
08-14-2008, 02:14 PM
hi,
as i add a new sheet, i place the newly added sheet name into column a of another sheet named "trackin".
i want to add a hyperlink each time i add a new sheet.
this is what i have but i get a "reference is not valid"
how do i reference this correctly?
thanks
zach
Sub test()
With Sheets("trackin")
rw = Sheets("trackin").Cells(Rows.Count, "a").End(xlUp).Row
shnm = .Range("a" & rw)
.Range("a" & rw).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"shnm!A1", TextToDisplay:=shnm
End With
End Sub
as i add a new sheet, i place the newly added sheet name into column a of another sheet named "trackin".
i want to add a hyperlink each time i add a new sheet.
this is what i have but i get a "reference is not valid"
how do i reference this correctly?
thanks
zach
Sub test()
With Sheets("trackin")
rw = Sheets("trackin").Cells(Rows.Count, "a").End(xlUp).Row
shnm = .Range("a" & rw)
.Range("a" & rw).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"shnm!A1", TextToDisplay:=shnm
End With
End Sub