Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Date Functions

Is there a native function in VBA to determine the number
of days in a specified month? For example, if I wanted
to know how many days were in January is there a function
that would return 31. This is also important for
February given leap year and all that good stuff.

Thanks,

Seth
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Date Functions

Hi Seth
if your date is in A1 the following formula calcualtes how many days
are within that specific month:
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))

for mor information on dates/times see
http://www.cpearson.com/excel/datetime.htm

Frank

Seth wrote:
Is there a native function in VBA to determine the number
of days in a specified month? For example, if I wanted
to know how many days were in January is there a function
that would return 31. This is also important for
February given leap year and all that good stuff.

Thanks,

Seth



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
Date functions jknapp1005 Excel Worksheet Functions 2 March 10th 09 08:15 PM
date functions meeric Excel Worksheet Functions 1 November 28th 07 07:01 PM
Date and Sum functions (HELP) aaronr Excel Discussion (Misc queries) 2 April 19th 06 07:30 PM
Date Functions KA Madrigal-Young Excel Discussion (Misc queries) 1 January 24th 06 07:27 PM
Date functions excelpomoc Excel Worksheet Functions 2 September 14th 05 04:58 PM


All times are GMT +1. The time now is 03:59 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"