Saving a row from one workbook to another without opening second workbook

shield

New Member
Joined
May 11, 2014
Messages
2
Hello,

I need some help with a macro. What I need it to do is search for the last entered value in column A in a workbook called "data" in a worksheet called "values" and then copy and paste the row to the same row in a workbook called "transfer" in a worksheet called "newvalues." The part that i cant figure out is how to do this without needing to open the second workbook. Also, i need the workbook "transfer" to auto save after the row is pasted, all without ever needing to open the second workbook. Both excel docs are located in the same folder. Any help would be much appreciated. Thanks!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I may be wrong, but I'm pretty sure you will have to open the workbook.

You will need to do something like this:

Code:
Application.Workbooks.Open ("Your File Name")


[COLOR=#008000]'Your Code Here[/COLOR]


Workbooks("Your File Name").Close SaveChanges:=[COLOR=#0000ff]True[/COLOR]

If you do not want to see the workbook opening and closing just use this line at the beginning of your code:

Code:
Application.ScreenUpdating =[COLOR=#0000ff] False[/COLOR]

You will need to set ScreenUpdating back to True at the end of your code.
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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