Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default count days between dates

Hello

I must be bleary eyed. Is there a VBA function which counts the number of
days between two dates (as in the workbooks)?

W


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default count days between dates

Dates & times are stored as numbers.

Therefore simply subtracting one from the other will give you the tim
between two dates. Note however that the date is the integer portio
only. If you need look at only the dates and ignore the time portio
use INT(a) - INT(b) or to round down to the nearest day int(a - b).

Hope it helps

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default count days between dates

Just subtract one date from the other.

If you want working days, you can get at the NETWORKDAYS fu nction by
setting a reference to ATPVBAEN.xks in TooleReferences, and then calll
directly with Run.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"cogent" wrote in message
...
Hello

I must be bleary eyed. Is there a VBA function which counts the number of
days between two dates (as in the workbooks)?

W




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default count days between dates

You just subtract

Dim a As Date, b As Date
a = #6/1/2004#
b = #6/10/2004#
MsgBox b - a

cogent wrote:

Hello

I must be bleary eyed. Is there a VBA function which counts the number of
days between two dates (as in the workbooks)?

W



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 specific days in between dates Gabe Excel Discussion (Misc queries) 2 April 5th 10 06:22 PM
Count days between text dates Benny Excel Discussion (Misc queries) 8 August 11th 09 05:58 PM
Count of days between dates Andy Excel Discussion (Misc queries) 3 April 15th 09 10:51 AM
Count days inside 2 dates Call me Ana, Ana Pego New Users to Excel 2 October 20th 08 12:46 AM
how to count number of days between 2 dates? doyree Excel Discussion (Misc queries) 10 February 10th 08 12:32 PM


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