LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Date ranges in VBA

All

Have borrowed some really useful code for calculating the number of emails
in a specific mail folder...

However, the code uses a single date - I would like to use a range
identified in two cells eg Date one - Sheet 1 A1 and Date two Sheet 1 A2

Below is the code and I am at a loss as to how to update this


Dim iCount As Integer, DateCount As Integer
Dim myDate As Date
EmailCount = objFolder.Items.Count
DateCount = 0
myDate = Sheets("Sheet1").Range("A1").Value

For iCount = 1 To EmailCount
With objFolder.Items(iCount)
If DateSerial(Year(.ReceivedTime), Month(.ReceivedTime),
Day(.ReceivedTime)) = myDate Then DateCount = DateCount + 1
End With
Next iCount

any assistance would be greatly appreciated

Shaz

 
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 Ranges Liz J[_2_] Excel Discussion (Misc queries) 2 January 16th 09 03:54 AM
Using IF and date ranges Romanli Excel Worksheet Functions 1 July 25th 08 12:20 AM
date ranges Carolina Girl Excel Worksheet Functions 3 May 9th 08 10:07 PM
compare date to various date ranges and sum value al Excel Worksheet Functions 2 January 10th 07 10:17 AM
If then Date Ranges Mark B Excel Worksheet Functions 0 November 30th 05 05:49 PM


All times are GMT +1. The time now is 06:45 PM.

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"