Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Hyperlink Alternate Sheets

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Hyperlink Alternate Sheets

Sub WorkSheetNames()
Dim a As Long
Dim s As Long
Dim shtName As String
s = 1
Range("A:A").ClearContents

For a = 2 To (Sheets.Count - 3) Step 2
shtName = Sheets(a).Name
Sheets(a).Hyperlinks.Add anchor:=Cells(a + 1, s), Address:="", SubAddress:="'" _
& shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName
Next a

Range("A1").Font.Bold = True
Range("A1").Value = "Main"
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Dolphinv4"
wrote in message
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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Hyperlink Alternate Sheets

Hi,

but then there'll be empty rows in between. Is there anyway these empty rows
won't be reflected or can be deleted?

Thanks.

"Jim Cone" wrote:

Sub WorkSheetNames()
Dim a As Long
Dim s As Long
Dim shtName As String
s = 1
Range("A:A").ClearContents

For a = 2 To (Sheets.Count - 3) Step 2
shtName = Sheets(a).Name
Sheets(a).Hyperlinks.Add anchor:=Cells(a + 1, s), Address:="", SubAddress:="'" _
& shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName
Next a

Range("A1").Font.Bold = True
Range("A1").Value = "Main"
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Dolphinv4"
wrote in message
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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Hyperlink Alternate Sheets


Anything else?
'--
Sub WorkSheetNames()
Dim a As Long
Dim R As Long
Dim shtName As String
R = 2
Range("A:A").ClearContents
For a = 2 To (Sheets.Count - 3) Step 2
shtName = Sheets(a).Name
Sheets(a).Hyperlinks.Add anchor:=Cells(R, 1), Address:="", SubAddress:="'" _
& shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName
R = R + 1
Next a
Range("A1").Font.Bold = True
Range("A1").Value = "Main"
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Dolphinv4"
wrote in message
Hi,
but then there'll be empty rows in between. Is there anyway these empty rows
won't be reflected or can be deleted?
Thanks
..

"Jim Cone" wrote:
Sub WorkSheetNames()
Dim a As Long
Dim s As Long
Dim shtName As String
s = 1
Range("A:A").ClearContents

For a = 2 To (Sheets.Count - 3) Step 2
shtName = Sheets(a).Name
Sheets(a).Hyperlinks.Add anchor:=Cells(a + 1, s), Address:="", SubAddress:="'" _
& shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName
Next a

Range("A1").Font.Bold = True
Range("A1").Value = "Main"
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Dolphinv4"
wrote in message
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hyperlink between sheets not working after converting to pdf LTJ Excel Discussion (Misc queries) 1 October 8th 07 04:06 PM
hyperlink some 10 sheets in a workbook anil Excel Discussion (Misc queries) 2 March 15th 07 01:19 PM
Hyperlink to hiden sheets Mick Excel Worksheet Functions 3 December 22nd 06 12:14 AM
auto hyperlink between many sheets? gab2409 Excel Discussion (Misc queries) 4 June 9th 06 10:34 PM
How can I use HYPERLINK in a conditional statement between sheets Mikey Excel Worksheet Functions 1 May 3rd 05 08:07 PM


All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"