View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default First day of month

Assuming you have a date in A1, in another cell enter:

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

VBA is similar, but use DateSerial instead of Date.

As for EOMONTH, this is supplied by the Analysis Tool Pack add-in, which may
not be installed. Check ToolsAddins in Excel.

NickHK

"Dianne Groom" wrote in message
...
A cell in an Excel workbook contains a date. I want to write macro code

to
generate, in another cell, the date of the first day of the next month.



I was going to use the Excel EOMONTH function, but Excel 2002, does not

seem
to support the function. I can generate the date using the DATE function,
and I tried using Application.WorksheetFunction in my macro, but it did

not
work with the Excel DATE function.



Any suggestions for macro code that will generate the first day of the

next
month would be appreciated.