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!
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

mrmmickle1

Well-known Member
Joined
May 11, 2012
Messages
2,456
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,545
Messages
5,529,458
Members
409,879
Latest member
Aussie_Excel_Wanna_Be
Top