logo
search
VBA & Macro Problems

How to Record a Word Macro to Split a Table Cell

Muhammad TalhaMuhammad Talha Oct 14, 2026 868 views

Question details

The user needs to record a macro to split a table cell in a Word document, but finds that the right-click context menu is unavailable during the recording process.

How to Record a Word Macro to Split a Table Cell
Product
Word
Device & OS
not provided
Scenario
Automating table editing tasks by recording a macro.
Observed behavior
When the macro recorder is active, right-clicking a table cell to access the 'Split Cells' option does not work as it normally would.
Before you start

Ensure you have the Developer tab enabled in your word processor's ribbon, as you will need it to start the Macro Recorder or open the Visual Basic Editor.

Solution 1Recommended

Use Ribbon Commands to Record the Split Cell Macro

Since the right-click menu is disabled during macro recording, you must use the standard ribbon commands to execute the split cell action.

The macro recorder in Word disables certain mouse interactions, such as right-clicking. To successfully record your macro, navigate through the top ribbon menus instead of using context menus.

1
Start recording the macro

Go to the Developer tab on the top ribbon and click on 'Record Macro'. Give your macro a name and click 'OK'.

2
Select the target table cell

Click inside the table cell that you wish to split while the recorder is running.

3
Access the Split Cells command

Navigate to the 'Table Tools - Layout' (or simply 'Layout') tab on the ribbon. In the 'Merge' group, click on the 'Split Cells' button.

4
Define row and column numbers

In the dialog box that appears, choose the number of columns and rows you need (for example, 2 columns and 1 row), then click 'OK'.

5
Stop the macro recorder

Return to the Developer tab and click 'Stop Recording' to finalize your macro.

Use Ribbon Commands to Record the Split Cell Macro
Macro Ready: You can now run this macro anytime to instantly split a selected cell into the dimensions you specified.
Advanced Document Automation

Automate Table Adjustments Effortlessly with WPS Writer

WPS Office provides a highly capable word processor with robust macro and VBA support. You can easily record macros to automate table edits like splitting cells, utilizing a familiar interface that handles complex automation smoothly.

  1. 1. Download and install WPS Office: Get the free suite from the official WPS website and install it on your device.
  2. 2. Open your document: Launch WPS Writer and open the document containing the table you want to modify.
  3. 3. Enable the Developer tab: Go to Options to enable the Developer tab, giving you full access to Macro and VBA tools.
  4. 4. Record or paste your macro: Click 'Record Macro' and use the Table Tools tab to split your cell, or open the VBA Editor to paste your specific cell-splitting code.
Excellent compatibility with Microsoft Word documents (.docx) and VBA scripts.Built-in Developer tools allow you to quickly record, edit, and run macros for table modifications.Intuitive ribbon interface makes navigating layout and merging tools simple.Free, lightweight, and highly efficient alternative for everyday office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why is the right-click menu disabled while recording a Word macro?

The macro recorder tracks explicit commands and keystrokes rather than mouse coordinate clicks. Right-click context menus are temporarily disabled to ensure that you select reliable, absolute command paths from the ribbon that the macro can repeat without error.

Can I modify the VBA code to split the cell into more rows or columns?

Yes. In the provided VBA code, you can easily alter the values for 'NumRows:=1' and 'NumColumns:=2' to whatever dimensions you require. For example, changing it to 'NumColumns:=3' will split the selected cell into three columns.

Will this split macro work if I have multiple cells selected?

The command 'Selection.Cells.Split' applies to the entire active selection. If you highlight multiple cells and run the macro, it will attempt to apply the split parameters to all selected cells, provided the table's structure supports the resulting grid layout.