MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Same Key Stroke without cell reference

Posted by Dan Oh on February 21, 2001 6:15 AM

I am new at macro. I have a huge data and I need to delete the last character
from each cell on the column.
What I like to do is to start at the top of the column where
I set my cell and go down to the very bottom cell entry and
erase the last character.
F2, delete, enter, arrow down .... repeat until
the last entry.

Posted by Faster on February 21, 2001 7:52 AM

Sub CutLast()
'you should use a copy of your column
'because this code will not allow you
'to undo the actions.

Do While ActiveCell <> ""
Dim MyCell As String
MyCell = ActiveCell.Text
ActiveCell = Left(MyCell, Len(MyCell) - 1)
Selection.Offset(1, 0).Select

End Sub