Extracting the numbers from the Text Field
John Spencer wrote:
Try this modification if you are passing in values that might be null
Function NumbersInString(WithNumbers As Variant) As Variant
Dim Temp As String
Dim T As Integer
If IsNull(WithNumbers) Then
NumbersInString = Null
Else
For T = 1 To Len(WithNumbers)
If IsNumeric(Mid(WithNumbers, T, 1)) Then
Temp = Temp & Mid(WithNumbers, T, 1)
End If
Next
NumbersInString = Temp
End If
End Function
I wonder if using Like "#" is faster or slower than
IsNumeric? At least Like generalizes to other sets of
characters more easily.
--
Marsh
MVP [MS Access]
|