Variable File Naming Using Macros

G

Guest

Is there a way to open a file and rename it using cells within the document
itself using a macro? (Variable File Name?)

Also, is there a way to open a file, using a macro again, by using criteria
on a cell in an open worksheet? (Variable File Call?)
 
F

Frank Kabel

Hi
yes you can do this. e.g.
sub save_it()
with activesheet.range("A1")
activeworkbook.saveas filename:= "C:\temp\" & .value & ".xls"
end with
end sub


Similar with opening workbooks. See workbooks.open in the vBA help
 

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