Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old August 6th, 2004, 12:52 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

  #2 (permalink)  
Old August 6th, 2004, 07:41 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default


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


  #3 (permalink)  
Old August 8th, 2004, 10:01 PM
Authorized User
 
Join Date: Feb 2004
Location: , , Denmark.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Look in the help and find
Datediff!
Cheers

  #4 (permalink)  
Old August 9th, 2004, 06:11 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.