Save file from the value of cell in different opened file

E

Elton Law

Dear Expert,

I have asked this question before.
Want to save the file name in accordnace to value in cell A1
Activeworkbook.Saves fileName:= Range("A1").Value
But that was supposed to be in same worksheet and file.

Say, if I want to save a file called ABC.XLS to ABC_20090430.XLS via VB
script, the file contains ABC_20090430.XLS is in file OPENFILE.XLS Cell V2
rather than ABC.xls.

So how to fine-tune the VB scripts please ?
 
J

Jacob Skaria

Assuming you have ABC.xls and Openfile.xls which are already saved and open
the below code will save ABC.xls as the name mentioned in Sheet1 Range V2 of
Openfile.xls..

Workbooks("ABC.xls").SaveAs FileName:=
Workbooks("Openfile.xls").Sheets("Sheet1").Range("V2")

Once you try this adjust the below code to suit your requirement

If this post helps click Yes
 
E

Elton Law

It works.
Thanks a lot !

Jacob Skaria said:
Assuming you have ABC.xls and Openfile.xls which are already saved and open
the below code will save ABC.xls as the name mentioned in Sheet1 Range V2 of
Openfile.xls..

Workbooks("ABC.xls").SaveAs FileName:=
Workbooks("Openfile.xls").Sheets("Sheet1").Range("V2")

Once you try this adjust the below code to suit your requirement

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top