jazminecat23
Programmer
Hi all -
I have a spreadsheet that has a command button with the following code. This spreadsheet is used to create monthly reports for various departments in our organization. I have a master report that I used to do this. Currently, I enter the specific department info, calculate the values, file-->save as for the specific dept, then convert all formulae to values and hide the rows and columns used to generate the data. I created a command button that has code in it to convert all the values, hide the necessary rows and columns, and hide the command button itself...but...I need it to FIRST prompt to Save As - because otherwise, the person I'm creating this tool for will end up saving over the master file. She needs to use this over and over again, to generate a whole set of reports, so I'm trying to make it as easy as possible, and avoid losing the master file by having it saved over.
Here's the code for the button now:
Is there code I can put in the beginning of this that will bring up the file-->save as window, and allow the file to be saved, and then continue running the macro?
Thanks in advance!
I have a spreadsheet that has a command button with the following code. This spreadsheet is used to create monthly reports for various departments in our organization. I have a master report that I used to do this. Currently, I enter the specific department info, calculate the values, file-->save as for the specific dept, then convert all formulae to values and hide the rows and columns used to generate the data. I created a command button that has code in it to convert all the values, hide the necessary rows and columns, and hide the command button itself...but...I need it to FIRST prompt to Save As - because otherwise, the person I'm creating this tool for will end up saving over the master file. She needs to use this over and over again, to generate a whole set of reports, so I'm trying to make it as easy as possible, and avoid losing the master file by having it saved over.
Here's the code for the button now:
Code:
Cells.Select
Range("A38").Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.ScrollRow = 1
Rows("1:8").Select
Range("A8").Activate
Selection.EntireRow.Hidden = True
Columns("A:E").Select
Range("A9").Activate
Selection.EntireColumn.Hidden = True
CommandButton1.Visible = False
Is there code I can put in the beginning of this that will bring up the file-->save as window, and allow the file to be saved, and then continue running the macro?
Thanks in advance!