Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date in VBA
I have the following If then statements:
If PublishMonth = "10/1/2005" Then MsgBox ("Add C1ANC Goals to Actuals, 1-3 and 4-6 (use N/A)") If PublishMonth = "2/1/2006" Then MsgBox ("Remove N/A. Use C1ANC's batch numbers") If PublishMonth = "3/1/2006" Then MsgBox ("Add 7-9 and adjust to leader's. Remove N/A. ") If PublishMonth = "4/1/2006" Then MsgBox ("Adjust 7-9 to leader's") If PublishMonth = "5/1/2006" Then MsgBox ("Adjust 7-9 to leader's") If PublishMonth = "6/1/2006" Then MsgBox ("Adjust 7-9 to leader's") If PublishMonth = "7/1/2006" Then MsgBox ("Adjust 10-12 to leader's") If PublishMonth = "8/1/2006" Then MsgBox ("Adjust 10-12 to leader's") If PublishMonth = "9/1/2006" Then MsgBox ("Adjust 10-12 to leader's") Instead of counting out 6 months from 10/1/05 and entering 2/1/06 into the statement, how can I have VBA figure 6 months from 10/1/05? Something like If PublishMonth = 10/1/05 + 6 then ...... If PublishMonth = 10/1/05 + 7 then ...... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date in VBA
Yes it does. Thanks.
"Don Guillett" wrote: this idea should help you. Sub addmonth() pm = "10/1/2006" MsgBox DateSerial(Year(pm), Month(pm) + 6, Day(pm)) End Sub -- Don Guillett SalesAid Software "StephanieH" wrote in message ... I have the following If then statements: If PublishMonth = "10/1/2005" Then MsgBox ("Add C1ANC Goals to Actuals, 1-3 and 4-6 (use N/A)") If PublishMonth = "2/1/2006" Then MsgBox ("Remove N/A. Use C1ANC's batch numbers") If PublishMonth = "3/1/2006" Then MsgBox ("Add 7-9 and adjust to leader's. Remove N/A. ") If PublishMonth = "4/1/2006" Then MsgBox ("Adjust 7-9 to leader's") If PublishMonth = "5/1/2006" Then MsgBox ("Adjust 7-9 to leader's") If PublishMonth = "6/1/2006" Then MsgBox ("Adjust 7-9 to leader's") If PublishMonth = "7/1/2006" Then MsgBox ("Adjust 10-12 to leader's") If PublishMonth = "8/1/2006" Then MsgBox ("Adjust 10-12 to leader's") If PublishMonth = "9/1/2006" Then MsgBox ("Adjust 10-12 to leader's") Instead of counting out 6 months from 10/1/05 and entering 2/1/06 into the statement, how can I have VBA figure 6 months from 10/1/05? Something like If PublishMonth = 10/1/05 + 6 then ...... If PublishMonth = 10/1/05 + 7 then ...... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenate including a date so that the date appears as a date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
Making a date go red, if date passes todays date. | Excel Worksheet Functions | |||
Report Date - Date Recv = Days Late, but how to rid completed date | Excel Worksheet Functions | |||
Date updates from worksheet to chart & changes date to a date series! Help!! | Charts and Charting in Excel |