![]() |
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 |
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 |
All times are GMT +1. The time now is 09:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com