VBA & Macro Problems

How to Use VBA to Copy One Column into Multiple Excel Columns

Aamir Naveed AkramAamir Naveed Akram Nov 2, 2026 870 views

Question details

The user needs to copy the values from one specific Excel column and repeat them across multiple adjacent columns (such as columns B through Z) using a VBA loop.

How to Use VBA to Copy One Column into Multiple Excel Columns
Product
Excel
Device & OS
not provided
Scenario
Automating the horizontal duplication of a data column across a specified number of target columns without copying underlying formulas.
Observed behavior
The user requires a macro that accurately repeats each source value across the destination columns while preserving values only, instead of manually copying and pasting.
Before you start

Ensure you have enabled the Developer tab in your spreadsheet ribbon and enabled macro execution in your Trust Center settings before running any VBA code.

Solution 1Recommended

Use a VBA Loop with the Offset Function

This method uses a simple loop combined with the Offset function to duplicate a specific range of values across a set number of columns next to the original data.

By setting the value of an offset range directly to the value of the source range, you bypass the clipboard. This is faster and ensures only the raw values are pasted.

1
Open the VBA Editor

Press 'Alt + F11' on your keyboard to open the Visual Basic for Applications (VBA) editor. Click on 'Insert' in the top menu and select 'Module'.

2
Write the offset loop macro

In the new module window, define your subroutine and source range. Then, write a For loop that dictates how many columns to copy across. For example: `Sub CopyColumns()` `Dim myRange As Range` `Dim x As Integer` `Set myRange = ActiveSheet.Range("A1:A100")` `For x = 1 To 25` `myRange.Offset(0, x).Value = myRange.Value` `Next x` `End Sub`

3
Run the macro

Place your cursor inside the macro code block and press 'F5', or click the green 'Run' button in the toolbar. The values from your source column will instantly populate the next 25 columns.

Use a VBA Loop with the Offset Function
Adjusting the Column Count: You can change '25' in the 'For x = 1 To 25' statement to the exact number of destination columns you require.
Efficient Macro Support in WPS Office

Run Macros and VBA seamlessly with WPS Spreadsheet

WPS Office provides robust support for Excel macros and VBA scripts, allowing you to automate repetitive tasks like copying columns with familiar coding syntax.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open the spreadsheet containing the column you want to copy.
  2. 2. Access the Macro Editor: Navigate to the 'Developer' tab on the ribbon and click on 'Macros' or 'Visual Basic' to open the built-in VBA editor.
  3. 3. Paste and run your script: Paste your copying loop script into a new module and click 'Run' to instantly duplicate your data across multiple columns.
Full compatibility with Microsoft Excel VBA syntax and objectsBuilt-in Macro Editor for intuitive script management and debuggingLightweight application that handles large macro operations smoothlyFree to use with comprehensive spreadsheet functionalities
microsoft office alternative - wps office

Frequently Asked Questions

Can I copy formats along with the values using VBA?

Yes. If you want to copy formatting in addition to the values, you cannot use the `.Value = .Value` method. Instead, you should use the `Copy` method combined with `PasteSpecial xlPasteFormats` inside your loop.

How do I start the copy from a different column?

You can adjust the starting column by changing the source range in your code. For example, to start from column C, modify your range definition to `Set myRange = Range("C1:C100")`.

Why am I getting an 'Out of Range' error when running the loop?

This error typically occurs if your loop attempts to paste data beyond the maximum number of columns allowed in a spreadsheet (16,384 columns in standard modern worksheets). Ensure your loop limit combined with your starting column does not exceed this boundary.