Hi im new using excel and i would like to count the cell that containg the values betweeen 500 and 750. this is the code that i wrote but i did something wrong that is not giving me the right answer. Can some one please help?
Sub Count()
Dim i As Integer
Dim j As Integer
Range("C3").Select
For i = 1 To 279
For j = 1 To 19
If i > 500 Then
ElseIf i <= 750 Then
i = i + 1
End If
Next j
Next i
Sheets("Sheet1").Select
Range("B13").Select
ActiveCell.Value = i
End Sub
Why use VBA for that?
Use COUNTIFS() function. Just enter it in cell B13 and adjust the range from A:A to whatever range you need to check in the formula.
=COUNTIFS(A:A, ">=500", A:A, "<=750")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With