How to Move Data from Column C to Column B with VBA in Excel
Question details
A beginner needs to use a VBA macro to automatically move all contents from column C into column B within a worksheet.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Reorganizing worksheet data efficiently by shifting an entire column's contents without having to manually cut and paste.
- Observed behavior
- The user wants a script that cuts the data from column C and places it directly into column B.
Before running the macro, verify that Column B is either empty or contains data you no longer need, as moving the data will overwrite the existing contents.
Use a VBA Macro to Cut and Paste Column C to Column B
This recommended method uses a straightforward VBA script to cut the entire Column C and paste it starting at cell B1.
VBA (Visual Basic for Applications) allows you to automate repetitive tasks in your spreadsheet. This specific script targets the entire C column, cuts it, moves it to the destination in column B, and then clears the clipboard to free up system memory.
Press Alt + F11 on your keyboard to launch the Visual Basic for Applications editor.
In the top menu of the VBA editor, click on Insert and then select Module to create a blank workspace for your code.
Copy and paste the following code into the module window: Sub MoveData() Range("C:C").Cut Destination:=Range("B1") Application.CutCopyMode = False End Sub
Close the VBA editor to return to your spreadsheet. Press Alt + F8, select MoveData from the Macro dialog box, and click Run.
To keep the macro for future use, click File > Save As, and choose Excel Macro-Enabled Workbook (*.xlsm) from the format dropdown. Remember to click 'Enable Content' if prompted when reopening the file.

Automate Your Workflow Easily with WPS Spreadsheet
WPS Spreadsheet fully supports VBA and Macros, allowing you to run scripts that move or format column data effortlessly. Enjoy a highly compatible and familiar interface that handles your Excel macro files smoothly.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook that requires data automation.
- 2. Access the Developer Tab: Navigate to the Developer tab on the top ribbon to easily access the VBA Editor and Macro manager.
- 3. Run Your Macro: Insert your VBA code in the module and execute it seamlessly, just as you would in Microsoft Excel.

Frequently Asked Questions
How do I move only specific rows instead of the entire Column C?
You can change the range defined in the VBA code. For example, to move only the first 20 rows, use the code: Range("C1:C20").Cut Destination:=Range("B1").
Can I copy the data to Column B without deleting it from Column C?
Yes. Simply replace the .Cut method with the .Copy method in your macro code. It should look like this: Range("C:C").Copy Destination:=Range("B1").
Why did my macro disappear after I saved and reopened my file?
This happens if you save the workbook in the default .xlsx format, which strips out VBA code for security reasons. Always ensure you save the file as an Excel Macro-Enabled Workbook (*.xlsm) to preserve your scripts.




