Copy and Paste Macro assistance

ryland00

Board Regular
Joined
Jun 13, 2014
Messages
76
Hello,

I have 2 separate workbooks, lets call them base and target. I need information copied and pasted from the base workbook into the target workbook, specifically columns D, K, R, Y, AF, AM, AT, BA, BH, BO, BV and CC. The workbooks are exactly the same, except the base has updated information in these columns. Within each workbook, there are about 95 different sheets (just want to reiterate they are set up exactly the same except for those columns) that I need copied from the base to the target. So, for instance, in each of the workbooks, the first sheet is B01019, then B01028, then B01035, etc etc etc. The reason this is needed is because the target workbook is my original workbook with all of my code, and the base is the one I sent to people without coding (in case you were curious).

Any help would be greatly appreciated as I have only really found information on taking many worksheets into one.

Thanks so much,

Ryan
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,658
Office Version
  1. 365
Platform
  1. Windows
Hi
This should do what you're after (for columns D & K only)
Code:
Sub Macro1()

    Dim Ws As Variant

    For Each Ws In Workbooks("[COLOR=#ff0000]Base.xls[/COLOR]").Worksheets
        Ws.Columns("D").Copy Workbooks("[COLOR=#ff0000]Target.xls[/COLOR]").Worksheets(Ws.Name).Columns("D")
        Ws.Columns("K").Copy Workbooks("[COLOR=#ff0000]Target.xls[/COLOR]").Worksheets(Ws.Name).Columns("K")
    Next Ws
    
End Sub
You'll need to change the file names to suit, & add another line for each column you want to copy.
HTH
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,827
Messages
5,855,877
Members
431,771
Latest member
CoryMelth

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
Top