View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dolphinv4 Dolphinv4 is offline
external usenet poster
 
Posts: 27
Default List Sheet & Hyperlink

Hi,

i have this macro which used to work but now it doesn't. This macro will
list all the sheets i have excluding those which ends with "-A". Now when i
click on the hyperlink, it shows a dialogue box "That name is not valid". Why
is this so?

Thanks.

Sub List_Hyperlink()

Range("A:A").ClearContents

x = 1
For a = 1 To (Sheets.Count - 14)
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