如果您正在尋找把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