Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default End of Month Date in Header

I would like the last date of the current month to appear in the worksheet
header. Can eomonth be used in a macro?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default End of Month Date in Header

You could, but you could use a simpler formula:


Dim myDate As Date
myDate = Date - Day(Date)

With Worksheets("Sheet1").PageSetup
.LeftHeader = Format(myDate, "mmmm dd, yyyy dddd")
End With


Subtracting 18 from May 18th, gives May the 0th. Or the last day of April.


CarrieW wrote:

I would like the last date of the current month to appear in the worksheet
header. Can eomonth be used in a macro?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Match Month in Date With Month in Header [email protected] Excel Worksheet Functions 1 August 17th 07 07:46 PM
Date arithmetic: adding 1 month to prior end of month date manxman Excel Worksheet Functions 2 July 14th 06 09:29 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM
=VLOOKUP(1,Nationality!B5:B29,IF(MONTH(date)6,MONTH(date)-6, MON Ali Excel Worksheet Functions 14 January 18th 06 08:20 AM


All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"