Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
C C is offline
external usenet poster
 
Posts: 61
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing User inputs apache007 Excel Discussion (Misc queries) 1 February 6th 10 05:11 PM
user inputs with Message Boxes Erik Excel Programming 5 January 28th 09 08:59 PM
User Forms & Checking Inputs Jez Excel Programming 1 February 6th 08 04:24 PM
Extend Border As User Inputs New Rows Paperback Writer Excel Discussion (Misc queries) 1 December 1st 06 02:58 PM
Text Box : Controlling what the user inputs Matthew Balch[_2_] Excel Programming 2 November 15th 06 10:46 AM


All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"