View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel/VBA - month dates

if Month(B1) 4 then
' greater than april



if Month(B1) Month(DateSerial(Year(B1),4,1)) then
' greater than april

--
Regards,
Tom Ogilvy

Simon wrote in message
...
Hi there,

I am trying to develop something using VBA that says

If the say B1 cell is greater than April
then
perform an action.

B1 contains a date, say 01/08/03.

I cant seem to get it to recognise that the month in B1 is
greater than April? I can do it in excel but not using
VBA code.

Thanks alot

Simon