Thread: Help with error
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Wiley Wiley is offline
external usenet poster
 
Posts: 86
Default Help with error

I'm a relative newby with VBA. I need to return the last day of the month
for a series of dates. I have found this formula many places on the web, but
get a compile error with it.

dtEOM =DATE(YEAR(A1),MONTH(A1)+1,0)

where dtEOM is my vairable declared as a Date. The error is a
'Compile Error: Expected: )'
and YEAR is highlighted.

My intent is to fill dtEOM with the month, create some record counts, and go
to the next month, reset the variable, and do it again. Your help is
appreciated.