VBA to copy cell value from the last row of the workbook to another workbook

shernel07

New Member
Joined
Jun 19, 2019
Messages
8
Hi there,

I have two workbooks eg. Data.xlsx and Final.xlsx

In Data.xslx I have the sum of A2:A3 in cell A4

Now I need a macro code to copy the data from cell A4 and transfer it to the Final.xlsx workbook in cell A4 for example.

P.S I need to data to get transferred not the formula present in A4.

Can you guys help me in this? Thanks
 
I followed your steps but it throws me an error Subscript out of range, run time error 9 and it highlights Set wb = Workbooks("Data.xlsx") in the debug option.
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I followed your steps but it throws me an error Subscript out of range, run time error 9 and it highlights Set wb = Workbooks("Data.xlsx") in the debug option.

is Data.xlsx open? if not, it needs to be open for this macro to run properly.
 
Upvote 0
Yes it worked I used to Open and Close function for it to partially open the data and get it populated. And thanks alot man. You are an angel! :)
Keep up the good work.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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