Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
As part of a larger procedure I want to check if all dates of some range fall between a lower limit (From) and an upper limit (Till). I thought this would do it . But no! Sub test() Dim DatOr As Range, From As Date, Till As Date Set DatOr = [E2:E6618] From = Application.InputBox("Date Begin Year ?", Type:=1) Till = Application.InputBox("Date End Year ?", Type:=1) MsgBox Application.CountIf(DatOr, "<" & From) & " " & Application.CountIf(DatOr, "" & Till) DatOr.Select End Sub I swear that 31/12/2006 and 1/1/2008 both appear in range DatOr ; all the other dates vary between 1/1/2007 and 31/12/2007 Funny thing : If I feed 1/1/2007 and 31/12/2007 respectively in the inputboxes I get 1 and 0 in the MsgBox. Can you figure the 0 ? Thank you very much for your help! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Countif gone wrong | Excel Worksheet Functions | |||
How to jump from a Form procedure to a Workbook or Module procedure? | Excel Programming | |||
.OnAction points to wrong file.module.procedure | Excel Programming | |||
What's wrong with my procedure to show tabs? | Excel Programming | |||
something wrong with my "countif" function | Excel Discussion (Misc queries) |