View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_3_] NickHK[_3_] is offline
external usenet poster
 
Posts: 415
Default User defined date entry into message box?

One thing, because you expect a Date variable back, you do not use the "Set"
key owrd ; that is only for Object.
Dim TodaysDate as Date

Also, if you actually want today's date, you do not need to ask the user ;
you have "Date", which returns today's date.
As for the last, that depends what you want to do...

NickHK

"Meltad" ...
Thanks Nick,

I've put this at the start of my macro...
Set TodaysDate = Application.InputBox(prompt:="Please enter today's date",
Type:=1)
How do I ensure a date is accepted and recognised later in the code?
How can I now use 'TodaysDate' to copy relevant rows from my spreadsheets?


"NickHK" wrote:

Look at Application.InputBox in help

NickHK

"Meltad" ...

Hi all,

Can I start my macro with a message box/prompt for the user to enter
the
date and set this as 'todaysdate' (or something!) - I would then use
this
user defined date to go into 3 other workbooks, select all data for
that
date, copy the rows and paste into the original workbook.
Is this possible?!

Thank you!