跳到主要內容

如何自動將光標移動到Excel中的特定單元格?

有時,出於某些目的,您可能需要跳到特定的單元格。 本文將詳細介紹將光標移動到特定單元格的方法。

使用“名稱”框將光標自動移動到特定的單元格
使用VBA代碼將光標自動移動到特定單元格


使用“名稱”框將光標自動移動到特定的單元格

名稱框可以幫助您輕鬆地將光標移動到Excel中的特定單元格。

1。 在裡面 姓名 框,輸入您要跳轉到的特定單元格引用,然後按 Enter 鍵。

然後,光標立即移動到指定的單元格。

備註:如果需要跳轉到另一個工作表中的指定單元格,例如,跳轉到Sheet30的單元格C2,請鍵入 Sheet2!C30 進入“名稱”框,然後按Enter鍵。


使用VBA代碼將光標自動移動到特定單元格

以下VBA代碼可幫助您立即移動到Excel中的特定單元格。

1。 按 其他 + F11 同時打開 Microsoft Visual Basic for Applications 窗口。

2。 在裡面 Microsoft Visual Basic for Applications 窗口,雙擊T他的工作簿 在左窗格中打開ThisWorkbook(代碼) 窗口。 然後將下面的VBA代碼複製並粘貼到窗口中。

VBA代碼:移至下一行的開頭或開頭以進行數據輸入

Sub jumpnext()
    Range("F100").Select
End Sub

備註:在代碼中,F100是您將跳轉到的指定單元格。 您可以根據需要進行更改。

3。 按 F5 鍵運行代碼,然後光標立即移動到當前工作表中的單元格F100。


相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Dear,
Please help me how to code : I want to move down row by row on tthe data already fillter
Current cursor at A6 (fix) because it 's Row Header, I want to move down :
Step 1 : move down to A9
Step 2 : move down to A11
Step 3 : move down to A15
(Do until blank)
Screenshot 2023-11-30 200730
(Please see srceen shot attacked)

Many Thanks
Ky
This comment was minimized by the moderator on the site
Sub jumpnext()
Range("F100").Select
End Sub

What chnage do i have to do so this code can be uased on all sheets of the workbook at the same time.

Regards,
This comment was minimized by the moderator on the site
Hi arvind,

The following VBA code can do you a favor. Please give it a try. Thank you.
Note: You need to put the VBA code in the ThisWorkbook (Code) editor.
Sub jumpnext()
'Updated by Extendoffice 20230109
Set CurrWS = ActiveSheet
    For Each WS In ThisWorkbook.Worksheets
    WS.Activate
        WS.Range("F100").Select
    Next
    CurrWS.Activate
End Sub

https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/select-same-cell.png
This comment was minimized by the moderator on the site
Hi,

Can you help with the following VBA code request please?

Sheet 1 is named "Master Asset" with a further 100 sheets named as "0001...0002...0003....0004 ~ 0100"

In any of each of the sheets "0001 ~ 0100"
I want to be able to select cell A4 which already contains text "Back to Master Asset" then press enter, to automatically jump back to cell J3 in the "Master Asset"

Thanks in advance.
Andy C.
This comment was minimized by the moderator on the site
Hi Andy Coghlan,
I can't find a way to trigger the macro with the enter key right now. The following VBA code can insert the same hyperlink in A4 of all worksheets at the same time. After clicking the hyperlink in A4, it will jump to J3 in the "Master Asset". Please give it a try.

Sub AddHyperlinks()
'Updated by Extendoffice 20220715
    Dim xRg, yRg As Range
    Set xRg = Worksheets("Master Asset").Range("J3")
    xStr = xRg.Address(External:=True)
    For Each Sh In Worksheets
        If Sh.Name <> "Sh.Name" Then
            Set yRg = Sh.Range("A4")
            yRg.Hyperlinks.Add anchor:=yRg, Address:="", SubAddress:=xStr, TextToDisplay:="Back to Master Asset"
        End If
    Next
End Sub
This comment was minimized by the moderator on the site
Bagiaimana mengisi textbox pada form dengan memilih data di cell/sheet yg dipilih dgn kursor ?
This comment was minimized by the moderator on the site
Hi Lelson,
Sorry I don't understand what you mean. Would you mind providing a screenshot of your data? Or try to be more specific about your question. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
you didn't sign the F5 for teh code, how it is gonna run by pressing F5?
This comment was minimized by the moderator on the site
Is it possible to move the active cell without pressing a key on the keyboard? For example, can I have the cell move down as soon as the cell above it is filled? I am looking for either a function or a VBA to run when a cell is filled. As soon as A3 has characters in it, is there a VBA to move the active cell down to A4?
This comment was minimized by the moderator on the site
Hi John,
I am confused on your question. How can we know if the cell is finish editing?
This comment was minimized by the moderator on the site
Sorry I mean to type "instantly jump to F8"
This comment was minimized by the moderator on the site
Hi James,
Please try the below code. After data has been entered into E6, press the Tab key or the Enter key, and the cursor will jump to F8 instantly.

Private Sub Worksheet_Change(ByVal Target As Range)

'Updated by Extendoffice 2020087

Dim tabArray As Variant

Dim i As Long

tabArray = Array("E6", "F8")

Application.ScreenUpdating = False

For i = LBound(tabArray) To UBound(tabArray)

If tabArray(i) = Target.Address(0, 0) Then

If i = UBound(tabArray) Then

Me.Range(tabArray(LBound(tabArray))).Select

Else

Me.Range(tabArray(i + 1)).Select

End If

End If

Next i

Application.ScreenUpdating = True

End Sub
This comment was minimized by the moderator on the site
How would I have the cursor move from Cell E6 to F8 once data has been entered into E6? I would like the cursor to ignore all the other lines in the E column and instantly jump to E6.
This comment was minimized by the moderator on the site
That's helpful thanks. However I would like to have a formula as the argument for the 'Range' function. Is this permissible? What I would like to do is have the user enter a number in a dialog box, then search for the first occurrence of that number in a range of cells, and then jump the cursor to that cell...
This comment was minimized by the moderator on the site
Hi Steve,
Sorry can't help you with that.
This comment was minimized by the moderator on the site
I'd like to make a macro that moves from one cell to the next, step by step.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations