How can I automate the saving of a worksheet?

  • Thread starter Thread starter maacmaac
  • Start date Start date
M

maacmaac

I want to automate an excel spreadsheet with a Macro. The macro I
currently have in the sheet is asking the user if he/she wants to save
the worksheet. If user indicates yes, I want to save the sheet but
only using the information that is in cell A1 (the information in this
cell is different everytime the user opens the document)

Thanks in advance for any comments!!!
 
I would think your macro would contain something like:


with activeworkbook
.SaveAs Filename:="c:\yourpath\" _
& .worksheets("sheet1").range("a1").value, _
fileformat:=xlWorkbookNormal
end with

But it would depend on what's in A1, too.

But remember that there are characters that are not allowed in a filename
(slashes come to mind).
 
Back
Top