Reading multiple numbers in one cell

  • Thread starter Richard Daniels
  • Start date
R

Richard Daniels

Hi

This will count all the occurances of a number in a given
cell

Function countNumbers(values As Range, NumberTOCount As
Integer) As Integer
Dim i As Integer, iResult As Integer
iResult = 0
For i = 1 To Len(values)
If Mid(values, i, 1) = NumberTOCount Then iResult
= iResult + 1
Next
countNumbers = iResult
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top