VBA to copy entire columns from one spreadsheet and insert the copied columns into multiple spreadsheets within many subfolders in a directory

ParrBee

New Member
Joined
Feb 20, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am new to macros/VBAs so I'm looking for help in writing this code.

I have a spreadsheet that is used as a data source (SourceFile), which contains data in Columns F, H, and I. I would like to copy the entire column of all three columns and INSERT them into multiple workbooks that are saved within different subfolders within a main directory. Ideally, I would have a code that can look at all subfolders within a directory, find each workbook and insert the copied Columns F, H, and I from my SourceFile.

The copied columns from the SourceFile (Columns F, H, I) need to be inserted in the same location in the destination workbooks (Columns F, H, I) --> example: data from Column F from the SourceFile needs to be inserted into Column F in the destination workbook. Because the destination workbooks already contain data, I cannot simply Copy & Paste. Rather, I need to "Insert-shift" columns first so I do not overwrite data contained in the destination workbook when inserting the copied columns from the SourceFile.

The destination workbooks contain different file extension types such as, xlsx, xls and csv. I want to be able to run the macro and insert the copied columns into all workbook extension types.

Is there a way to write a macro that can copy columns from the SourceFile, insert-shift columns in the destination file and then paste the copied columns from the SourceFile to the specific location inside the destination workbooks?

Thanks in advance!
 

Forum statistics

Threads
1,226,840
Messages
6,193,278
Members
453,788
Latest member
drcharle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top