Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get user inputs
I have a workbook that opens up upon macro run. It opens up in Read Only and
would like to prompt the user to save the file at this point. Once they have saved the workbook under a new name I would like to delect the original file located at c:\Sales.xls. I would also like to ask the user to Enter the start date in MMM YY and end date MMM YY. Then starting in cell E1 Enter the reporting period they specified. Can someone help me out with the code to do this? Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get user inputs
To open up the SaveAs dialog...
Application.Dialogs(xlDialogSaveAs).Show To delete original file... - get the filename before doing a SaveAs Dim strFilename as string 'save current file name [to be deleted] strFilename = ActiveWorkbook.FullName 'Save the file as a different name / location Application.Dialogs(xlDialogSaveAs).Show 'Delete the original file Kill strFilename To put start / stop date in cell 'E1' ActiveSheet.Range("E1").Value = _ "'" & InputBox("Enter Start Date (mmm yy):") ActiveSheet.Range("E1").Value = _ ActiveSheet.Range("E1").Value & " - " & _ InputBox("Enter End Date (mmm yy):") -- Hope this helps. If it does, please click the Yes button. Thanks in advance for your feedback. Gary Brown "C" wrote: I have a workbook that opens up upon macro run. It opens up in Read Only and would like to prompt the user to save the file at this point. Once they have saved the workbook under a new name I would like to delect the original file located at c:\Sales.xls. I would also like to ask the user to Enter the start date in MMM YY and end date MMM YY. Then starting in cell E1 Enter the reporting period they specified. Can someone help me out with the code to do this? Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Forcing User inputs | Excel Discussion (Misc queries) | |||
user inputs with Message Boxes | Excel Programming | |||
User Forms & Checking Inputs | Excel Programming | |||
Extend Border As User Inputs New Rows | Excel Discussion (Misc queries) | |||
Text Box : Controlling what the user inputs | Excel Programming |