I have the following code:
If dgt IN("0","1","2","3","4","5","6","7","8","9") Then
pnm = pnm & dgt
End If
I am looping through phone numbers, social security numbers and similar character strings that may have varying formats and trying to produce a sting of just the number.
This gives me a "Compile Error: Syntax Error" message
I've also tried dgt >= 0 and dgt <= 9. That tells me I can't do numeric comparisons with characters
I've also tried between 0 and 9 and I get a message saying that it was looking for a Then or a GoTo and the word "between" is highlighted.
How can I determine if the character is between 0 and 9?
Or, better yet, is there a VBA function that strips off formatting?
If dgt IN("0","1","2","3","4","5","6","7","8","9") Then
pnm = pnm & dgt
End If
I am looping through phone numbers, social security numbers and similar character strings that may have varying formats and trying to produce a sting of just the number.
This gives me a "Compile Error: Syntax Error" message
I've also tried dgt >= 0 and dgt <= 9. That tells me I can't do numeric comparisons with characters
I've also tried between 0 and 9 and I get a message saying that it was looking for a Then or a GoTo and the word "between" is highlighted.
How can I determine if the character is between 0 and 9?
Or, better yet, is there a VBA function that strips off formatting?