ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   rename current file save and delete original (https://www.excelbanter.com/excel-programming/350402-rename-current-file-save-delete-original.html)

valve79

rename current file save and delete original
 

Hey guys
I have this problem and I cant figure it out. I made a macro to save
the worksheet under a name that comes from cell N1. When the user is
done with form they hit my macro and it saves it in LAN and everything
is good. ( here is the problem ) Then another user goes in the Lan
finds the file and approves the form that adds two letters to the Cell
N1 (AP for approved ) that means it changes the file name and saves it
as a new file.
I need help how to keep that name with the same file even if it
changes. Here is the macro
any help appreciated - Thanks

Private Sub CommandButton1_Click()
thisfile = Range("n1").Value
activeworkbook.SaveAs Filename:="E:\CFA Checklist\" & thisfile &
".xls"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox "File has been saved and Printed Location E:\CFA Checklist"
activeworkbook.Close
End Sub


--
valve79
------------------------------------------------------------------------
valve79's Profile: http://www.excelforum.com/member.php...o&userid=30431
View this thread: http://www.excelforum.com/showthread...hreadid=501232



All times are GMT +1. The time now is 06:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com