我刚开始遇到excel工作簿的问题,我最初使用excel 2010创建并使用了将近2年,IT更新了我们的办公室计算机,现在我已经安装了Office 2016的win10。
我正在使用的VBA代码:
Private Sub Worksheet_Activate()
Dim wSheet As Worksheet
Dim l As Long
l = 1
With Me
.Columns(1).ClearContents
.Cells(1, 1) = "INDEX"
.Cells(1, 1).Name = "Index"
End With
For Each wSheet In Worksheets
If wSheet.Name <> Me.Name Then
l = l + 1
With wSheet
.Range("A1").Name = "Start_" & wSheet.Index
.Hyperlinks.Add Anchor:=.Range("A1"), Address:="", _
SubAddress:="Index", TextToDisplay:="Back to Index"
End With
Me.Hyperlinks.Add Anchor:=Me.Cells(l, 1), Address:="", _
SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name
End If
Next wSheet
End Sub
当我打开debuger时,以.Hyperlinks.Add Anchor和SubAddress开头的行标记为yelow ...你能帮助我吗? 谢谢......