开发笔记,Excel VBA。

1. 取得所有的Sheet,并在当前单元格上列出

 
Sub GetAllSheets()
    For i = 1 To Sheets.Count
            ActiveCell.Offset(1, 0).Range("A1").Select
           ActiveCell.Value = Sheets(i).Name
    Next i
End Sub

2. 在上面的基础上,加上链接:

Sub GetAllSheets()
For i = 1 To Sheets.Count
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=Sheets(i).Name + "!A1", TextToDisplay:=Sheets(i).Name

Next i
End Sub

3.

posted @ 2012-03-23 22:25  NewSea  阅读(530)  评论(0编辑  收藏  举报