Copying and pasting data from one spreadsheet to another

paulandrews

New Member
Joined
Feb 20, 2011
Messages
10
Hi All,

I need to create a macro to which copy and pastes data from workbook one to workbook 2, while also ensuring that the pasted data reforms to workbook 2's formulas. I would like to be able to hit a "Submit" button which would copy and paste the data from workbook 1 to workbook 2. I am using Excel 2007.

I'd appreciate any help you have... I have a deadline and I'm terrible at excel!!!!

Thanks and Regards,
Paul
 
Last edited:
Thanks for that! But it seems it's still not working. It doesn't seem to like this line here:
Code:
    LastCol = Sheets(ts).Cells(2, Sheets(ts).Columns.Count).End(xlToLeft).Column
I really appreciate all your help with this, by the way. :)
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
In post #6 I asked you if you had a sheet called "Sheet5".
In post #7 you said...
No, it's called utilization data. I updated the code to reflect this and on running the macro the same error appears with the same line of code indicated and causing the error.
Then in post #9 you posted your code that used the sheetname "Sheet5".
If you are using "utilization data" rather than "Sheet5", change the assignment of the "Target Sheet" variable from this...
Code:
    ts = "Sheet5"
To this...
Code:
    ts = "utilization data"
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,633
Members
452,933
Latest member
patv

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