Excel工作表索引

我有下面的代码,伟大的工程,但我想修改它,而不是用一个新的索引replace索引页的第1列,我宁愿在单元格C11开始范围。 现在,新的索引从索引表的单元格A1开始。

这里是代码:

 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 

以上是我想要在单元格C11和下面显示的内容…

  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 

我已经成功地修改了代码,以便链接返回到每个工作表上的索引没有问题,但我不知道如何索引被更换从单元格C11开始

Cells(1, 1)是指A1, Cells(11, 3) 11,3 Cells(11, 3)是指C11。

也许这样

 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim wSheet As Worksheet Dim l As Long With Me .Columns(3).ClearContents .Cells(10, 3) = "INDEX" .Cells(10, 3).Name = "Index" End With 'The above is what I want to have show up in cell C11 and below... l = 10 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, 3), Address:="", _ SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name End If Next wSheet End Sub