raajnabriz
Board Regular
- Joined
- Jun 11, 2014
- Messages
- 115
Please someone provide me with a formula to count a number from 1 to 1500. eg number 6 how many times it occurs, i need a formula
Function COUNTINT(startVal As Long, endVal As Long, chk As Integer) As Variant
If chk > 9 Then COUNTINT = "1-9 only"
For x = startVal To endVal
For y = 1 To Len(x)
If Mid(x, y, 1) = chk Then
COUNTINT = COUNTINT + 1
End If
Next y
Next x
End Function
Thanks Mr. Rick, but the given formula isn't working.