Date Programming via a MSGBOX

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to create a worksheet that when opens, asks the user what date
they would like to create the schedule for (i.e. today, tomorrow, next
saturday etc).

Lets say this date is input to a varible of [mydate]

I would then like my worksheet to take the given date (that the user has
input [mydate]) and populate other dates that are within the woksheet based
on [mydate].

For example, if I enter date of next saturday (mm/dd/yy - 11/19/05) - then
other dates within the woksheet automatically calculate and display their
dates.

The other dates within the worksheet are things like ([mydate] - 7 days),
([mydate] + 3 weeks)....

Can anyone advise the best way to acheive this?

Thanks
 
Use formulas in the other cell that calculate their dates off of a single
reference cell. Place your mydate value in the reference cell.

assume A1 is the reference cell.

=if(A1="","",A1+7)

format the cell with the formula as date.
 
Use Inputbox to get the date

myDate = Inputbox("Input date")
Worksheets("Sheet1").Range("A1").Value =CDate(myDate)

and then have formulae in the worksheet to caluclate the other dates such as
=A1+7.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top