LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Last Day of the month

You are close to my problem. What I am trying to do is if (Day Is 15) do this
I do not care what month or year are only the day. If day=15 b3=19.96
Looking thru and seen your entry so decided to throw out my problem
Thanks

"Gary''s Student" wrote:

Say the date is in cell A1. In another cell enter:

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


To do the same thing with VBA:

Sub lastday()
Dim d As Date
d = Evaluate("DATE(YEAR(A1),MONTH(A1)+1,0)")
MsgBox (d)
End Sub

--
Gary''s Student - gsnu200830


"JT" wrote:

I have a date in a cell and want to find out what the last day for the month
is. Is there an easy way to do this with VB and just include it with the
rest of the code?

Thanks for the help
--
JT

 
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
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Retrieve data for previous 3, 6, 12 month given current month GB Excel Worksheet Functions 4 July 19th 07 11:58 PM
copy worksheet from previous month and rename to current month Dan E. Excel Programming 4 December 8th 05 09:40 PM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 06:50 AM.

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

About Us

"It's about Microsoft Excel"