"Save As" cell reference in a macro

  • Thread starter Thread starter jreiv
  • Start date Start date
J

jreiv

I am looking for a way to create a macro that would save
a file according to a cell reference. This could include
a cell within a worksheet, or the Title field in the
Properties menu. Any information would be extremely
helpful.
 
Hi
try the following 8using cell A1 from sheet 1)
sub save_it()
dim wks as worksheet
dim fname
Dim path

set wks = worksheets("sheet1")
path = "C:\Temp\"
fname=CStr(wks.Range("A1").value)

ActiveWorkbook.SaveAs Filename:=path & fName
end sub
 
Hey....You,

See my reply to Mike D above. It sound like an evolution
similar to the example I gave him. You can apply
Cell.Value to retrieve cell contents or populate a
variable.

Matthew

=}
 

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

Back
Top