Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I'm tinkering with the following situation:
The range Sheets(1).Range("B2:B" & lr) is populated only by dates.
In cell I need to count all the dates included in the range delimited by the variablese date1 and date2.
At the moment the result is 0, but it is not correct.
How can I figure it out?
Thank's in advance.
I'm tinkering with the following situation:
VBA Code:
cell.value = Application.WorksheetFunction.CountIfs(Sheets(1).Range("B2:B" & lr), ">=" & date1, Sheets(1).Range("B2:B" & lr), "<=" & date2)
The range Sheets(1).Range("B2:B" & lr) is populated only by dates.
In cell I need to count all the dates included in the range delimited by the variablese date1 and date2.
At the moment the result is 0, but it is not correct.
How can I figure it out?
Thank's in advance.