VBA & Macro Problems

How to Move Data from Column C to Column B with VBA in Excel

Huda QurayshiHuda Qurayshi Nov 11, 2026 869 views

Question details

A beginner needs to use a VBA macro to automatically move all contents from column C into column B within a worksheet.

How to Move Data from Column C to Column B with VBA
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 you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to launch the Visual Basic for Applications editor.

2
Insert a New Module

In the top menu of the VBA editor, click on Insert and then select Module to create a blank workspace for your code.

3
Paste the Macro 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

4
Run the Macro

Close the VBA editor to return to your spreadsheet. Press Alt + F8, select MoveData from the Macro dialog box, and click Run.

5
Save as a Macro-Enabled Workbook

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.

Use a VBA Macro to Cut and Paste Column C to Column B
Undoing Macro Actions: Actions performed by a VBA macro cannot be undone using the standard Undo button (Ctrl + Z). It is highly recommended to save a backup copy of your workbook before running the script.
Efficiently manage data and macros

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. 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook that requires data automation.
  2. 2. Access the Developer Tab: Navigate to the Developer tab on the top ribbon to easily access the VBA Editor and Macro manager.
  3. 3. Run Your Macro: Insert your VBA code in the module and execute it seamlessly, just as you would in Microsoft Excel.
Full compatibility with Microsoft Excel VBA macros and .xlsm filesLightweight application that runs smoothly even on older devicesIntuitive developer tools that make it easy to write and run scriptsFree and easy-to-use alternative for advanced spreadsheet automation
microsoft office alternative - wps office

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.