PDA

View Full Version : Solved: Remove UCase from string



ulfal028
09-19-2006, 01:07 AM
I have a string from which I'd like to remove four characters (starting from the right), but I'm not sure how to do it. Appreciate some guidance.

Dim S As String
Dim T As String
S = Sheets("Sheet1").Range("A1")
T = S ' and removing UCase(Right(S, 4)) from S

Bob Phillips
09-19-2006, 01:14 AM
Dim T As String
Dim S As Long

With Sheets("Sheet1").Range("A1")
S = Len(.Value) - 4
T = Left(.Value, S)
End With

ulfal028
09-19-2006, 01:47 AM
Yes, that did it. Many thanks!