D
Dolphinv4
Hi,
I have a macro that list all the sheets i have and this listing will
hyperlink to all the sheets automatically. What i want instead is to have the
macro list alternate sheets instead, for ex, i have the following sheets:
Main (Listing of all sheets)
AAA
AAA-A
BBB
BBB-A
CCC
CCC-A
I want the macro to only, in the "Main" Sheet, to only list the following
sheets:
Main
AAA
BBB
CCC
How can I do that with the macro? Below is my current code.
Sub WorkSheetNames()
Range("A:A").Select
Selection.ClearContents
Dim a As Long
Dim s As Long
Dim shtName As String
s = 1
For a = 1 To Sheets.Count - 3
shtName = Sheets(a).Name
Sheets(a).Hyperlinks.Add anchor:=Cells(a, s), Address:="", SubAddress:="'" _
& shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName
Next a
Range("A1").Select
Selection.Font.Bold = True
End Sub
Thanks.
Dolphinv4
I have a macro that list all the sheets i have and this listing will
hyperlink to all the sheets automatically. What i want instead is to have the
macro list alternate sheets instead, for ex, i have the following sheets:
Main (Listing of all sheets)
AAA
AAA-A
BBB
BBB-A
CCC
CCC-A
I want the macro to only, in the "Main" Sheet, to only list the following
sheets:
Main
AAA
BBB
CCC
How can I do that with the macro? Below is my current code.
Sub WorkSheetNames()
Range("A:A").Select
Selection.ClearContents
Dim a As Long
Dim s As Long
Dim shtName As String
s = 1
For a = 1 To Sheets.Count - 3
shtName = Sheets(a).Name
Sheets(a).Hyperlinks.Add anchor:=Cells(a, s), Address:="", SubAddress:="'" _
& shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName
Next a
Range("A1").Select
Selection.Font.Bold = True
End Sub
Thanks.
Dolphinv4