Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[b]
Public Function stripNumbers(inputStr As String, Optional strLength As Integer) As String
[/b]
If strLength = 0 Then strLength = 1
'inputStr = "2.x 2.A 2.B 2.C 3.A 3.B" -> x, A, B, C, A, B
Do
Do While ((VBA.UCase(VBA.Left(inputStr, 1)) < "A" Or _
VBA.UCase(VBA.Left(inputStr, 1)) > "Z")) And inputStr <> ""
inputStr = VBA.Mid(inputStr, 2)
Loop
If inputStr = "" Then
Exit Do
Else
If stripNumbers = "" _
Then stripNumbers = VBA.Left(inputStr, strLength) _
Else stripNumbers = stripNumbers & ", " & VBA.Left(inputStr, strLength)
inputStr = VBA.Mid(inputStr, strLength + 1)
End If
Loop
End Function
[b]
Public Function stripText(inputStr As String) As String
[/b]
Dim intValue As Double
'inputStr = "2.x 2.A 2.B 2.C 3.A 3.B" -> 2, 2, 2, 2, 3, 3
Do
Do While (Not VBA.IsNumeric(VBA.Left(inputStr, 1)) And inputStr <> "")
inputStr = VBA.Mid(inputStr, 2)
Loop
If inputStr = "" Then
Exit Do
Else
intValue = VBA.Val(inputStr)
If stripText = "" _
Then stripText = VBA.Val(intValue) _
Else stripText = stripText & ", " & VBA.Val(intValue)
inputStr = VBA.Mid(inputStr, VBA.Len(intValue) + 1)
End If
Loop
End Function