On Wed, 04 May 2005 10:59:55 -0600, JE McGimpsey
<(E-Mail Removed)> wrote:
>one way:
>
>Put this in the ThisWorkbook Code module:
>
> Private Sub Workbook_Open()
> Dim vResponse As Variant
> Do
> vResponse = Application.InputBox( _
> Prompt:="Enter start date:", _
> Title:="Start Date", _
> Default:=Format(Date, "dd mmm yyyy"), _
> Type:=2)
> If vResponse = False Then Exit Sub 'User cancelled
> Loop Until IsDate(vResponse)
> Range("B7").Value = CDate(vResponse)
> End Sub
This works marvellously, thank you! I just changed the macro name to
the autorun one so that that this macro pops up immediately upon
opening the workbook. This is great! The sole purpose of the
spreadsheet is to create a new time sheet for the employees for every
2 week pay period.
Actually, I just thought of something that would make this spreadsheet
perfect. Is there a way to get this user input into one more cell,
say A5? On testing the above situation, I realized that this is so
fantastic that if we could get another cell populated with the start
date, that that would mean that the user needs to only input _one_
items, the initial date called for!
The above start date goes at the top of the column that has each date.
Along the right-hand side people put their hours worked. But just
above B7 where these dates start, there is a box where they must write
in the start and end dates of that pay period. I just thought that if
I split this into 2 cells and have A5 receive the same data input as
B7, then the cell underneath I could easily code to automatically put
in the end date. These are always 2 weeks apart on a Wednesday.
Thanks so much! This is totally awesome. Though I always credit all
these nifty tricks to you all here in the Excel ngs, there's no
question that you all make me look very, very good! <lol>
>In article <058501c550c3$30840390$(E-Mail Removed)>,
> "StargateFanFromWork" <(E-Mail Removed)> wrote:
>
>> I found the autorun code for a macro to work on Excel 2000
>> startup, so I have that. But I was hoping to do something
>> other than a message box. What is needed is for the user
>> to input a start date into the macro that the macro would
>> then drop into the appropriate cell (in this case, B7).
>> The spreadhseet is then geared to dump dates in various
>> other cells based on that one initial date. Is there a
>> way to do this, pls?
>>
>> (The Excel programming group seems to be down, otherwise
>> I'd ask there. That's an off occurrent, I've never seen
>> groups down before. <g>)
>>
>> Thank you.
D