Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Master workbook that needs to be renamed before use so that the
master remains blank of data and ready for the next event. I need a way to pause the macro and let the user enter a new name, hit save and the macro continue. Currently when I try to record, I hit file/save-as and the save window opens, awaiting input, I then cannot pause or stop recording as it blips me as there is no input. I don't want to have the new name inserted as it will change every 6 months. I would be satisfied with the macro stopping after the save-as window is opened so the user could input a new name and manually save it. Please be specific on where to place the code as I am an intermediate on macro's and worse on VBA. I do know how to step into it, but very unknowledgeable on editing the code. thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a look at Application.GetSaveAsFilename. You can capture the
value entered by the user and pass it to your SaveAs code. Kinda hard to help without seeing your current code. Mikeeusa wrote: I have a Master workbook that needs to be renamed before use so that the master remains blank of data and ready for the next event. I need a way to pause the macro and let the user enter a new name, hit save and the macro continue. Currently when I try to record, I hit file/save-as and the save window opens, awaiting input, I then cannot pause or stop recording as it blips me as there is no input. I don't want to have the new name inserted as it will change every 6 months. I would be satisfied with the macro stopping after the save-as window is opened so the user could input a new name and manually save it. Please be specific on where to place the code as I am an intermediate on macro's and worse on VBA. I do know how to step into it, but very unknowledgeable on editing the code. thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, I looked at a bunch of messages and put a few together and tore some
apart and came up with the simple following code: Sub saveas() ' ' saveas Macro ' Macro recorded 8/21/2007 by Michael F. O'Brien ' ' Keyboard Shortcut: Ctrl+u ' Application.DisplayAlerts = False ActiveWorkbook.saveas Filename:=Range("I3").Value Application.DisplayAlerts = True End Sub The value in I3 is input by the user prior to clicking the corresponding button to run the macro. It seems to work! I did notice that in 1 of the threads the user reported that his file extension of .xls had changed to 'file'. That didn't happen to me, but might it happen? Like I said, this seems to work, am I missing a problem or should this be the fix I need? "JW" wrote: Have a look at Application.GetSaveAsFilename. You can capture the value entered by the user and pass it to your SaveAs code. Kinda hard to help without seeing your current code. Mikeeusa wrote: I have a Master workbook that needs to be renamed before use so that the master remains blank of data and ready for the next event. I need a way to pause the macro and let the user enter a new name, hit save and the macro continue. Currently when I try to record, I hit file/save-as and the save window opens, awaiting input, I then cannot pause or stop recording as it blips me as there is no input. I don't want to have the new name inserted as it will change every 6 months. I would be satisfied with the macro stopping after the save-as window is opened so the user could input a new name and manually save it. Please be specific on where to place the code as I am an intermediate on macro's and worse on VBA. I do know how to step into it, but very unknowledgeable on editing the code. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can I write an Excel macro to pause for data entry then continue? | Excel Discussion (Misc queries) | |||
Excel Macro: Pause & ask user: "Are you sure you want to continue? | Excel Discussion (Misc queries) | |||
Can you pause a macro in excel to input data and continue? | Excel Discussion (Misc queries) | |||
Pause code, wait for input, no input received, carry on with the code | Excel Programming | |||
pause for input during macro | Excel Programming |