I had searched the net for SAVEAS and nothing come close to what I needed.
I have a workbook (a template) "RAD Analysis.xlsm" and in the sheet "RAD" cell A2 = 8/3/2018 and I want to force a SAVEAS filename as: "RAD Analysis for the month of August-2018.xlsm" - how do I write the vba for this - in workbook beforeclose or beforesave?
I declared nWB as ActiveWorkbook.name
ndate as date ** date in sheet RAD cell A2
set ndate = WorksheetFunction.text(ndate,"mmmmmmmm-yyyy") ** is this correct?
set nWB = WorksheetFunction.left(nWB,len(nWB)-5) ** getting the name without the ext .xlsm
set NewWBname = nWB & " for the month of " & Str(ndate) & ".xlsm"
here I am getting error message...
The procedure I would like to request is:
Whenever the user click [X] at the top right or exit the workbook (if there are changes made),
there should appear a saveas dialog box wherein the default is the above NewWBname (.xlsm)
If the user tried to use the original name "RAD Analysis" - it should loop again for the default filename.
many many many thanks
I have a workbook (a template) "RAD Analysis.xlsm" and in the sheet "RAD" cell A2 = 8/3/2018 and I want to force a SAVEAS filename as: "RAD Analysis for the month of August-2018.xlsm" - how do I write the vba for this - in workbook beforeclose or beforesave?
I declared nWB as ActiveWorkbook.name
ndate as date ** date in sheet RAD cell A2
set ndate = WorksheetFunction.text(ndate,"mmmmmmmm-yyyy") ** is this correct?
set nWB = WorksheetFunction.left(nWB,len(nWB)-5) ** getting the name without the ext .xlsm
set NewWBname = nWB & " for the month of " & Str(ndate) & ".xlsm"
here I am getting error message...
The procedure I would like to request is:
Whenever the user click [X] at the top right or exit the workbook (if there are changes made),
there should appear a saveas dialog box wherein the default is the above NewWBname (.xlsm)
If the user tried to use the original name "RAD Analysis" - it should loop again for the default filename.
many many many thanks