I am looking for some help fixing my counting problem. I am trying to count the number of rows that meet 2 criteria. The CountIf is using 2 different labels as the criteria. Here is what I have so far.
Code:Private Sub CmdBtn_Click() 'Perform search of column 'D' and return 'results to LblNum Dim num As Integer ActiveSheet.Unprotect num = Application.CountIf(Sheets("Sheet1").Range("D:D", LblDate1) - Application.CountIf(Sheets("Sheet1").Range("D:D", LblDate2))) LblNum = num ActiveSheet.Protect End Sub




Reply With Quote