ページ

2009年11月14日土曜日

【vba_excel】ワークシート一覧

Private Sub Worksheet_Activate()
Dim wst As Worksheet
Dim l As Long
l = 1
With Me
.Columns(1).ClearContents
.Cells(1, 1) = "一覧"
.Cells(1, 1).Name = "Index"
End With

For Each wstt In Worksheets
If wst.Name <> Me.Name Then
l = l + 1
Me.Hyperlinks.Add anchor:=Me.Cells(l, 1), Address:="", SubAddress:= _
"Start" & wst.Index, TextToDisplay:=wst.Name
End If
Next wst

End Sub

0 件のコメント: