Fix Horizontal Scrolling in the Excel VBA Editor
Question details
The user needs a way to scroll horizontally in the Excel VBA editor when touchpad gestures do not work.

- Product
- Microsoft Excel VBA editor
- Device & OS
- Windows
- Scenario
- The user is editing VBA code with lines wider than the editor window and wants to navigate horizontally using a touchpad.
- Observed behavior
- Vertical touchpad scrolling works in the VBA editor, but horizontal gestures are ignored even though they work in Excel worksheets and other Windows applications.
Open the VBA editor with Alt+F11 and select a code window containing a line wider than the visible area. Check whether horizontal scrolling works in the Excel worksheet to help distinguish an editor-specific limitation from a touchpad issue.
Navigate with the VBA Editor Scrollbar or Keyboard
Use these workarounds when horizontal touchpad gestures are ignored in the code window.
There is no reliable built-in setting that enables horizontal touchpad scrolling in the VBA editor.
In Excel, press Alt+F11, then open the relevant module or worksheet code window in the VBA editor.
Drag the horizontal scrollbar at the bottom of the code window to move left or right. If necessary, maximize the code window and look for the scrollbar below the code.
Click a long line of code and use the Left and Right Arrow keys to move the cursor. Press End to move to the end of the line or Home to return to the beginning; the editor view follows the cursor.

Update Office, Windows, and the Touchpad Driver
Check for updates if you want to rule out software or driver issues, although updates may not change the VBA editor's behavior.
Work with Excel Files in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easy to move everyday workbook tasks. It does not fix scrolling in Microsoft's VBA editor, and macro compatibility may vary.

Frequently Asked Questions
Is there a setting to enable horizontal touchpad scrolling in the VBA editor?
There is no reliable built-in setting for it. Use the horizontal scrollbar at the bottom of the code window or navigate through a line with the arrow keys, Home, and End.
Why does horizontal scrolling work in Excel but not in the VBA editor?
The VBA editor is a separate interface and may handle touchpad gestures differently from Excel worksheets. Working worksheet scrolling does not guarantee that the same gesture will work in the editor.
How can I reach the end of a long line of VBA code?
Click the line in the VBA code window and press End. Press Home to return to the beginning, or use the arrow keys to move through the line.
Will updating my touchpad driver fix the problem?
A driver update may help if the issue is driver-related, but it is not guaranteed to change the VBA editor's gesture support. Check your device manufacturer's support page or Windows Update for an available driver.




