View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] HammerJoe@gmail.com is offline
external usenet poster
 
Posts: 126
Default Getting error using Month()

Can someone help me with this?

I dont know why the month() doesnt work and I need to compare todays
date with a date on a cell and match the month.
If the month are the same then do something, if it is different then
do something else.

Thanks

On Feb 8, 1:58*am, " wrote:
Hi,

I am confused and need some assistance.
In my Vba code I am trying to verify if todays month is different than
the one in cell.
Problem is I am getting an error using the Month().

MsgBox (Month(MainWorksSheet.Range("B19").Value))

The code above gives me the error that the Object doesnt support the
property.
The *range value is a date 2008/07/02.

Using the Year() function it works and returns 2008 as it should.
What am I missing with the month function?

Thanks