The formula is read as =COUNTIF("Range",DATE(Year,Month,Day))Code:ActiveCell.FormulaR1C1 = "=COUNTIF(R[-2]C:RC,DATE(2007,1,1))"
I need a little help with countif and dates in vba. I have a spreadsheet that has different dates in column 3. I need to count the number of times a specific date appears in this column using vba. I'm thinking countif should work, but I can't get it to count the dates.
Or in VBA:
Code:rngLastRow = Application.CountIf(Range("A:A"), DateValue("3/15/2007")) ' or rngLastRow = Application.CountIf(Columns(1), DateValue("3/15/2007") ' or rngLastRow = Application.CountIf(Columns(1), DateSerial(2007,3,15)
Last edited by shg; April 20th, 2007 at 04:03.
There are currently 1 users browsing this thread. (0 members and 1 guests)