Pulling apart a string
Sorry. I got busy doing my job... :-)
Here is the code...
Sub test()
MsgBox FindDigits("SS600S162-43")
MsgBox FindDigits("SS1100S162-43")
End Sub
Public Function FindDigits(ByVal strInput As String) As Integer
If IsNumeric(Mid(strInput, 6, 1)) Then
FindDigits = CInt(Mid(strInput, 3, 4))
Else
FindDigits = CInt(Mid(strInput, 3, 3))
End If
End Function
--
HTH...
Jim Thomlinson
"Kevin O'Neill" wrote:
Wow very nice. Can that be translated into VBA? If not it is still OK,
I can probally work around it. Thanks.
|