Wrox Programmer Forums how to calculate difference in dates
 |
 Excel VBA Discuss using VBA for Excel programming.
 Welcome to the p2p.wrox.com Forums. You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com

August 6th, 2004, 12:52 AM
 ashu_gupta75 Authorized User Join Date: Jan 2004 Posts: 36 Thanks: 0 Thanked 0 Times in 0 Posts
how to calculate difference in dates

Hi!

How can i calculate the difference between 1-jul-2004 and 5-aug-2004, in VBA, in terms of number of days?

Thanks!
ashu

August 6th, 2004, 07:41 PM
 tajin Registered User Join Date: Jun 2004 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts

if A3= 5-aug-04, and B3= 1-jul-04, then the diff in C3 is
C3= VALUE(VALUE(A3)-VALUE(B3))= 35

August 8th, 2004, 10:01 PM
 slgknjn Authorized User Join Date: Feb 2004 Posts: 44 Thanks: 0 Thanked 0 Times in 0 Posts

Hi
Look in the help and find
Datediff!
Cheers

August 9th, 2004, 06:11 AM
 ashu_gupta75 Authorized User Join Date: Jan 2004 Posts: 36 Thanks: 0 Thanked 0 Times in 0 Posts

Thanks! Datediff worked. :)

 Similar Threads Thread Thread Starter Forum Replies Last Post calculate a number between two dates in time t400 SQL Server 2000 8 September 5th, 2006 01:14 PM Calculate a difference percentage skwilliams Classic ASP Basics 15 April 4th, 2006 06:46 AM Urgent! how to calculate difference between dates Subuana Beginning VB 6 2 March 22nd, 2006 05:34 PM How to Calculate dates in datagrid columns chiefouko VS.NET 2002/2003 2 July 15th, 2004 01:24 AM calculate time between two dates RMorales2831 Access 1 February 13th, 2004 11:38 PM