Copying one sheet to other Sheets

jrodrig50

New Member
Joined
Feb 10, 2012
Messages
3
Hello,
Could someone provide me some direction in developing a macro for copying elements from one worksheet to multiple other worksheets.

A little description of what I would like to accomplish: I have 10 columns of data in sheet 1 of a workbook. What I would like to do is copy columns: A,B,C,D,E, and F to sheet2, then I would like to copy columns A,B,C,D,E, and G to sheet 3, and then I would like to copy columns A,B,C,D,E, and H to sheet 4.

As you can see the first 5 columns are copied to a new worksheet, plus one varying column.

To make things more interesting, I would like to make this dynamic. Such that, in the future I may need the first 6 columns to be constantly copied, or the first 7 depending on the data.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I've started by declaring a variable for the number of static columns, and another variable for the number of varying columns like so:

Public Sub CopyMacro_1()
Dim iBannerBreaks As Integer
Dim iNumOpens As Integer

iBannerBreaks = InputBox("Please enter the number of Banner Break columns: ")
iNumOpens = InputBox("Please enter the number of Open Ends: ")

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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