VBA & Macro Problems

Move an Excel Selection to the Top of the Next Column After Enter

John WilsonJohn Wilson Nov 12, 2026 868 views

Question details

The user wants the active cell to move to the top row of the next column after entering data in the last row of an input column.

Move an Excel Selection to the Top of the Next Column After Enter
Product
Microsoft Excel
Device & OS
not provided
Scenario
Entering values down a fixed row range and continuing data entry column by column.
Observed behavior
Excel's standard Enter key navigation moves down or follows the configured direction, but it does not automatically wrap from the bottom of one column to the top of the next column.
Before you start

Decide the exact input range before adding the macro, such as A2:D10. Save the workbook as an Excel Macro-Enabled Workbook (*.xlsm) and enable macros when opening it.

Solution 1Recommended

Use a worksheet VBA event to wrap to the next input column

Use this method when you need Excel to move from the last row of one defined input column to the first row of the next column.

A Worksheet_SelectionChange event can watch the active cell and redirect the selection when it reaches the bottom row of your input range. Place the code in the specific worksheet module, not in a standard VBA module.

1
Open the worksheet code module

In Excel, right-click the worksheet tab that contains the input cells and choose View Code. Alternatively, press Alt+F11 and double-click the relevant worksheet under Microsoft Excel Objects.

2
Add the selection-change macro

Paste this code into the worksheet code window, then change A2:D10 to your intended input range: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim inputRange As Range Set inputRange = Me.Range("A2:D10") If Target.CountLarge > 1 Then Exit Sub If Intersect(Target, inputRange) Is Nothing Then Exit Sub If Target.Row = inputRange.Rows(inputRange.Rows.Count).Row Then If Target.Column < inputRange.Columns(inputRange.Columns.Count).Column Then Application.EnableEvents = False Me.Cells(inputRange.Row, Target.Column + 1).Select Application.EnableEvents = True End If End If End Sub

3
Save and test the navigation

Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm). Enter data through the input range and press Enter until you reach the bottom cell in a column; the selection should move to the top cell of the next input column.

4
Adjust the range when needed

Edit the Set inputRange = Me.Range("A2:D10") line to match your layout. For example, use Me.Range("B3:F20") if entry starts at B3 and ends at F20.

Use a worksheet VBA event to wrap to the next input column
Macro behavior depends on the selected cell: This event runs whenever the selection changes, including when you click a cell. Keep the input range limited so the macro does not redirect navigation elsewhere on the worksheet.
Simplify spreadsheet data entry with WPS Office

Create custom column-to-column data entry navigation in WPS Spreadsheets

WPS Spreadsheets provides familiar worksheet navigation and macro tools for structured data-entry workflows. You can create a macro-enabled spreadsheet, add worksheet VBA-style event code where supported, and use a defined input range to guide users from one column to the next.

  1. 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, select Spreadsheets, and open the XLSX or XLSM workbook that contains your data-entry table.
  2. 2. Define the data-entry range: Identify the first and last cells users should fill, such as A2:D10, so the navigation logic only applies to intended input cells.
  3. 3. Open the macro editor: Use the Developer or Tools menu to open the macro or Visual Basic editor, then select the worksheet associated with the input table.
  4. 4. Add and test the event code: Insert the worksheet selection-change code, update its range reference, save as an XLSM file, and test movement from the last row of each column.
Supports structured data-entry navigation across a defined spreadsheet rangeFamiliar spreadsheet interface for editing cells, formulas, and macrosCompatible with Microsoft Excel XLSX and macro-enabled XLSM workbook formatsLightweight office suite for opening, editing, and sharing spreadsheets
microsoft office alternative - wps office

Frequently Asked Questions

Can Excel make Enter move from the bottom of a column to the top of the next column without VBA?

No. Excel's Enter direction setting can move the active cell down, up, left, or right, but it cannot create a custom bottom-to-top column wrap pattern. A worksheet event macro is needed for that behavior.

Where should I paste the Worksheet_SelectionChange code?

Paste it into the code module for the specific worksheet: right-click the worksheet tab, choose View Code, and insert the procedure there. Do not place this event procedure in a standard module.

Why does the macro move the selection when I click cells?

Worksheet_SelectionChange runs whenever the selected cell changes, whether you press Enter, use an arrow key, or click a cell. Restricting the code to a defined input range helps prevent unwanted movement outside the table.

What file type should I use for this Excel navigation macro?

Save the workbook as an Excel Macro-Enabled Workbook (*.xlsm). The regular XLSX format does not retain VBA macros.

How do I stop the macro after the last column?

The sample code checks whether the active cell is before the final input column. When the last column is reached, it does not select another column, so normal worksheet navigation can continue.