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

Hi Guys,

As a part of a macro that i am doing, the amount of cases before th
week that is been worked on must be counted. Is there a way of coding
pop up to ask the user to enter the date to count back from.

i.e when compling the data for the week ending 30/06/04, all the date
before and including the 23/06/04 must be counted.


Is there any way of doing this through macro?
Any help on this would be great....

Thanks in Advance,
Cathal

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Counting Dates


dim dt as Date
res = InputBox("Please enter last date of count")
dt = Cdate(res)

msgbox application.countif(Range("B:B"),format(dt,"dd/mm/yy"))


--
Regards,
Tom Ogilvy




"CPower " wrote in message
...
Hi Guys,

As a part of a macro that i am doing, the amount of cases before the
week that is been worked on must be counted. Is there a way of coding a
pop up to ask the user to enter the date to count back from.

i.e when compling the data for the week ending 30/06/04, all the dates
before and including the 23/06/04 must be counted.


Is there any way of doing this through macro?
Any help on this would be great....

Thanks in Advance,
Cathal.


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Counting Dates

Cathal,

I would suggest getting the user tog put the start date in a cell, and then
have a worksheet formula like

=COUNTIF(A1:A100,"<="&B1-7)

--

HTH

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

"CPower " wrote in message
...
Hi Guys,

As a part of a macro that i am doing, the amount of cases before the
week that is been worked on must be counted. Is there a way of coding a
pop up to ask the user to enter the date to count back from.

i.e when compling the data for the week ending 30/06/04, all the dates
before and including the 23/06/04 must be counted.


Is there any way of doing this through macro?
Any help on this would be great....

Thanks in Advance,
Cathal.


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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Counting Dates

Bob i think this would be more suitable, but how do i get a pop u
asking the user to enter the date in cell e.g. S18, in the forma
mm/dd/yyyy, then to enter the amount of rows, with dates before e.g
05/30/2004, into cell S19???

Thanks a mil for this help.
Cathal

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Counting Dates

Cathal,,

I don't know where your dates are, but let's say they are in A1:R20, then
in S19, add

=COUNTIF(A1:R20,"<="&S18-7)

I was suggesting you don't bother with a pop-up, but just tell the user to
put a date in S18, the formula will then automatically count the number.

--

HTH

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

"CPower " wrote in message
...
Bob i think this would be more suitable, but how do i get a pop up
asking the user to enter the date in cell e.g. S18, in the format
mm/dd/yyyy, then to enter the amount of rows, with dates before e.g.
05/30/2004, into cell S19???

Thanks a mil for this help.
Cathal.


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



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
Counting Dates Mark Solesbury[_2_] Excel Worksheet Functions 3 May 6th 08 06:01 PM
Counting Dates Marie Excel Discussion (Misc queries) 3 June 4th 07 01:23 AM
counting occasions dates occur between 2 dates hoyt New Users to Excel 5 June 16th 06 08:11 AM
Counting dates, within a list of dates jrheinschm Excel Worksheet Functions 7 April 19th 06 06:13 PM
Counting Dates Jerry Excel Worksheet Functions 3 March 11th 05 05:19 AM


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