combine multiple columns in excel into one column [Excel VBA]

If you want to combine multiple columns in excel into one column in excel using excel VBA macro, then use below code.

Output of "combine multiple columns in excel into one column" VBA macro output

This macro combines data in multiple columns into one column.

  • When you run the macro, it asks you to enter the number of columns to combine (starting from column A), For example, If you are thinking on “how to merge two columns in excel”, enter 2 and press ENTER button

VBA macro to combine multiple columns in excel into one column

Where to paste VBA code in Excel?

  1. Copy above code
  2. Open Microsoft excel
  3. Press ALT+F11 (keyboard shortcut to open VBA editor)
  4. Paste the code in VBA editor (at the beginning)
  5. Click on save button
  6. Close the VBA editor window.

How to run the macro in excel?

  1. Press ALT+F8 (keyboard shortcut to view macros).below window opensview-macros-excel
  2. Select ‘combineMultipleColumnsData’ macro
  3. Click ‘Run’ button

Also see VBA macro to remove empty columns

About the Author

SRINI S

A passionate blogger. Love to share solutions and best practices on wordpress hosting, issues and fixes, excel VBA macros and other apps

Leave a Reply

Your email address will not be published. Required fields are marked *