Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this function:
Function PositionFirstNONNumberInString(strString As String) As Long Dim i As Long Dim btArray() As Byte btArray = strString For i = 0 To UBound(btArray) Step 2 If btArray(i) < 48 Or btArray(i) 57 Then PositionFirstNONNumberInString = i \ 2 + 1 Exit Function End If Next PositionFirstNONNumberInString = -1 End Function RBS "Chaplain Doug" wrote in message ... Excel 2003. What VBA string function(s) can I use to accomplish the following: I want to pass a string that may or may not contain a telephone number. I want to check to see if it is indeed a telephone number. That is, I want to check to see if the string contains only telephone type info (i.e., 0123456789()- ) or conversely, I want to check if the string contains non-telephone type info (i.e., alpha). How can I accomplish this? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Function to evaluate function as string | Excel Worksheet Functions | |||
string function help | Excel Discussion (Misc queries) | |||
VBA function : How to search a string in another string? | Excel Programming | |||
Add Function to String | Excel Worksheet Functions | |||
String Function | Excel Programming |