In cell A1 the user enters a value (ie O8, U50, etc)
Two different tasks need to be performed depending on the first letter of the string (O or U) and another task is dependent on the number following the O or U.
I cant get this to work...
Function GetRight(stringToRip)
stringToRip = Right(stringToRip, Len(stringToRip) - 1)
GetRight = stringToRip
End Function
Function GetLeft(stringToRip)
stringToRip = Left(stringToRip, (1 - Len(stringToRip)))
GetLeft = stringToRip
End Function
Sub Main()
Dim uValue As String
Dim OorU As Integer
uValue = Cells(1, 1)
If GetLeft(uValue).Value = "O" Then
OorU = GetRight(uValue).Value
' Performs tasks
End If
End Sub
Any help?
This message was edited by Derek_35 on 2002-05-12 18:13
Two different tasks need to be performed depending on the first letter of the string (O or U) and another task is dependent on the number following the O or U.
I cant get this to work...
Function GetRight(stringToRip)
stringToRip = Right(stringToRip, Len(stringToRip) - 1)
GetRight = stringToRip
End Function
Function GetLeft(stringToRip)
stringToRip = Left(stringToRip, (1 - Len(stringToRip)))
GetLeft = stringToRip
End Function
Sub Main()
Dim uValue As String
Dim OorU As Integer
uValue = Cells(1, 1)
If GetLeft(uValue).Value = "O" Then
OorU = GetRight(uValue).Value
' Performs tasks
End If
End Sub
Any help?
This message was edited by Derek_35 on 2002-05-12 18:13