如果您正在寻找把A229到可见的工作表区域的左上角,然后首先要过去的,你希望工作表的可见部分愚弄的Excel并回到它。
在A13中,放置一个超链接去到A1229,而不是A229。
Sub setup_Hyperlinks()
With Worksheets("Sheet1")
With .Range("A13")
.Hyperlinks.Delete
.Hyperlinks.Add Anchor:=.Cells(1), Address:="", SubAddress:="Sheet1!A1229", _
ScreenTip:="Jump to row 229", TextToDisplay:="Row 229"
End With
End With
End Sub
注意,实际子地址目标A1229
,不A229
。
用鼠标右键单击工作表的名称选项卡,然后选择查看代码。当VBE打开时,将一个粘贴到工作表代码表中,名为Book1 - Sheet1(Code)。
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells(1, 1).Row > 1000 Then 'this will depend on how you craft the method for your own purposes
Application.Goto _
Reference:=Target.Cells(1, 1).Offset(-1000, 0)
'[optional] move one row down for personal aesthetics
'ActiveWindow.SmallScroll Down:=-1
End If
End Sub
...或者,
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If ActiveCell.Row > 1000 Then 'this will depend on how you craft the method for your own purposes
Application.Goto _
Reference:=ActiveCell.Offset(-1000, 0)
'[optional] move one row down for personal aesthetics
'ActiveWindow.SmallScroll Down:=-1
End If
End Sub
使用一个或另一个但不是两者。前者似乎在我的系统上的屏幕“闪光”稍微少一些。
你可以使链接大火,找到您根据链接点击想要的数据的功能,然后做一个范围(“A”&行).Activate – MatthewD