Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
i got a macro to copy and special paste data in order to get a accumalative
sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Try this:
If Date = dateserial(year(date),Month(date)+1,0) then 'do something Else 'do something else End If Is that something you can work with? -------------------------- Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "pswanie" wrote in message ... i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
The following is probably what you want...
If Date= DateSerial(Year(Date), Month(Date) + 1, 0) Then ' << Today is the last day of the month Else ' << Today is not the last day of the month End If Notice I use the VBA Date function and not the VBA Now function (Now contains time of day which is immaterial). Rick "pswanie" wrote in message ... i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Another one...
if month(date) = month(date+1) then 'not the last day of the month else 'is the last day of the month end if pswanie wrote: i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
jip great stuff!!!!
worked. (i should have said if yesterday were the last day. in other words check if today is the first day of the month) But ill play around with your answer thanx Phillip |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Nice and concise, Dave....I like that approach.
Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Another one... if month(date) = month(date+1) then 'not the last day of the month else 'is the last day of the month end if pswanie wrote: i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Maybe even
if day(date+1) = 1 then Ron Coderre wrote: Nice and concise, Dave....I like that approach. Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Another one... if month(date) = month(date+1) then 'not the last day of the month else 'is the last day of the month end if pswanie wrote: i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Maybe even
if day(date+1) = 1 then I really like that one! Rick Ron Coderre wrote: Nice and concise, Dave....I like that approach. Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Another one... if month(date) = month(date+1) then 'not the last day of the month else 'is the last day of the month end if pswanie wrote: i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Awww....Now you're just showing off! <g
Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Maybe even if day(date+1) = 1 then Ron Coderre wrote: Nice and concise, Dave....I like that approach. Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Another one... if month(date) = month(date+1) then 'not the last day of the month else 'is the last day of the month end if pswanie wrote: i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip -- Dave Peterson -- Dave Peterson |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if is last day of month then, else
Nope. Just fixing the last one <vbg.
Ron Coderre wrote: Awww....Now you're just showing off! <g Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Maybe even if day(date+1) = 1 then Ron Coderre wrote: Nice and concise, Dave....I like that approach. Best Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "Dave Peterson" wrote in message ... Another one... if month(date) = month(date+1) then 'not the last day of the month else 'is the last day of the month end if pswanie wrote: i got a macro to copy and special paste data in order to get a accumalative sales data. i want to add to it so that it check if today is the last day of the month. something like if now() = lastday of month then run macro else range a1.value = "" end if thanx Phillip -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel to make the days cary over month to month automaticly | New Users to Excel | |||
Check Input for Valid Month | Excel Programming | |||
check for last day of month | Excel Programming | |||
Last Saturday of each month(check on Monday) | Excel Programming | |||
Check month | Excel Programming |