noboffinme
Registered User.
- Local time
- Today, 13:06
- Joined
- Nov 28, 2007
- Messages
- 288
Hi
I have the below code to remove 4 characters from the cells contents
I find it isn't having any effect on the cells though??
Can anyone explain where this code is wrong, I want to adapt it to be used to truncate from the start or the end of the cells contents & be used with Text & also Numbers.
---------------------------------
Sub right_char_trim()
Dim i As Integer
For i = Application.ActiveSheet.Range("A65536").End(xlUp).Row To 2 Step -1
ActiveCell.Activate
Cells(i, 1) = Right(Cells(i, 1), Len(Cells(i, 1) - 4))
Next i
End Sub
---------------------------------------------
I have the below code to remove 4 characters from the cells contents
I find it isn't having any effect on the cells though??
Can anyone explain where this code is wrong, I want to adapt it to be used to truncate from the start or the end of the cells contents & be used with Text & also Numbers.
---------------------------------
Sub right_char_trim()
Dim i As Integer
For i = Application.ActiveSheet.Range("A65536").End(xlUp).Row To 2 Step -1
ActiveCell.Activate
Cells(i, 1) = Right(Cells(i, 1), Len(Cells(i, 1) - 4))
Next i
End Sub
---------------------------------------------