Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default List Sheets excluding sheets named ***-A

Hi,

I want to have a Main page whereby it'll list all the sheets and hyperlink
to them. However, I want to list only those sheets which does not end with
"-A". I can't list alternate sheets because there are some sheets that does
not follow by a "**-A" sheet behind, for example,

AAA
AAA-A
BBB
BBB-A
CCC
DDD
EEE
EEE-A

How can I do that with a macro?

Thanks!

Dolphinv4
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default List Sheets excluding sheets named ***-A

Right click your main page sheet tab, view code and paste this in

Sub ShLink()
x = 1
For a = 1 To Sheets.Count
shtName = Sheets(a).Name
If Right(shtName, 2) < "-A" Then
Sheets(a).Hyperlinks.Add anchor:=Cells(x, 1), Address:="", SubAddress:="'" &
shtName
x = x + 1
End If
Next a
End Sub

Mike

"Dolphinv4" wrote:

Hi,

I want to have a Main page whereby it'll list all the sheets and hyperlink
to them. However, I want to list only those sheets which does not end with
"-A". I can't list alternate sheets because there are some sheets that does
not follow by a "**-A" sheet behind, for example,

AAA
AAA-A
BBB
BBB-A
CCC
DDD
EEE
EEE-A

How can I do that with a macro?

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
Add new named sheets David T Excel Discussion (Misc queries) 2 February 21st 07 04:33 AM
Sheets named from range, and copy data? [email protected] Excel Discussion (Misc queries) 4 January 12th 07 02:53 PM
Rows to Named Sheets Steved Excel Worksheet Functions 2 August 8th 06 10:44 AM
Dynamic named range across multiple sheets babycody Excel Discussion (Misc queries) 3 July 24th 05 06:03 AM
Named list of sheets Ch. Kinnewig Excel Worksheet Functions 2 March 1st 05 10:09 AM


All times are GMT +1. The time now is 10:16 PM.

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

About Us

"It's about Microsoft Excel"