Ambiguous name

I have entered and ran debug on the function below:
Function NumberOut(rng As Range)
Dim i As Integer
For i = 1 To Len(rng)
Select Case Asc(Mid(rng.Value, i, 1))
Case 0 To 64, 123 To 197
Case Else
NumberOut = NumberOut & Mid(rng.Value, 1, 1)
End Select
Next i
End Function

Open in new window

However, when I try to execute the function in Excel, =NumberOut(A2:A7), I get an error "Ambiguous name"?
Is there a limitation on the number of modules in Excel that's keeping me from this?
Frank FreeseAsked:
Who is Participating?
MacroShadowConnect With a Mentor Commented:
You probably have another Function or sub-routine by the same name somewhere in your file.
Frank FreeseAuthor Commented:
Let me check that
Frank FreeseAuthor Commented:
You nailed it! Thanks
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Frank FreeseAuthor Commented:
Thank you very much
Martin LissOlder than dirtCommented:
From the name of the UDF I would guess that you were trying to remove everything from the target cell except numbers, in other words produce 1237 from a123%^c7. But your code does the opposite. And if you do want to extract the numbers I would suggest just looking for Ascii values of 48 to 57 which are the numbers, since there are many more non-numeric characters.
Frank FreeseAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.