Attached is the following Saveas macro that I have.
Basically it does what I want. I push a button, the Save As option comes up, the Path is 99% there (Each file has 1 addtional step which must be done manually!) and I get to choose the file name.
Everything works now, no little nasty error codes Great .
However I would like to take this a step further and fill the Filename using a cell on the worksheet. I do not however want the file to automatically save as I need to go one step further in allocating the correct path (As stated earlier).
Is this possible?
I would also like to add todays date at the front of the filename.
Let me know what you think
Private Sub CommandButton2_Click()
ChDrive "S"
ChDir "S:\Activity\LONDON REGIONAL 992\ACTIVE ACCOUNTS"
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
On Error Resume Next
ActiveWorkbook.SaveAs Filename:=fileSaveName, FileFormat:=xlNormal
ActiveWorkbook.Close
End If
End Sub
Basically it does what I want. I push a button, the Save As option comes up, the Path is 99% there (Each file has 1 addtional step which must be done manually!) and I get to choose the file name.
Everything works now, no little nasty error codes Great .
However I would like to take this a step further and fill the Filename using a cell on the worksheet. I do not however want the file to automatically save as I need to go one step further in allocating the correct path (As stated earlier).
Is this possible?
I would also like to add todays date at the front of the filename.
Let me know what you think
Private Sub CommandButton2_Click()
ChDrive "S"
ChDir "S:\Activity\LONDON REGIONAL 992\ACTIVE ACCOUNTS"
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
On Error Resume Next
ActiveWorkbook.SaveAs Filename:=fileSaveName, FileFormat:=xlNormal
ActiveWorkbook.Close
End If
End Sub