View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lonnie M. Lonnie M. is offline
external usenet poster
 
Posts: 184
Default Need help with countif or another count function

michael, Try the followning; assuming Letter is in column 'A' and Date
is in Column 'C':

Sub LetterCount()
Dim C&, X&, cnt&
Dim myLetter As String
Dim minDate, maxDate As Date
myLetter = whatever letter
minDate = whatever date
maxDate = whatever date
C = Range(Cells(2, 1), Cells(2, 1).End(xlDown)).Rows.Count
For X = 1 To C
If Cells(X + 1, 3) = minDate Or Cells(X + 1, 3) = maxDate Then
If Cells(X + 1, 1) = myLetter Then
cnt = cnt + 1
End If
End If
Next X
MsgBox "The letter """ & myLetter & """ appears in " & cnt & " rows."
End Sub

HTH--Lonnie M.