How do I get Excel to enter a cell and delete the last character typed?

S

Shaka215

Hello! Any help with this issue is much appreciated...What I am trying
to do is have a macro enter a cell of the end-user's choice and delete
the last character in that cell. I have tried to all sorts of things
including SENDKEY but the problem is it deletes the entire contents of
the active cell...I just need a macro to work as a backspace to delete
the last character entered...any ideas? Any help is much appreciated!!!
Thanks so much!

Example...

CELL ORINGAL TEXT = "Buttons"
=========================
Macro ran once.. = "Button"
Macro ran twice.. = "Butto"
Macro ran trice.. = "Butt"
and so on...
 
R

Ron Rosenfeld

Hello! Any help with this issue is much appreciated...What I am trying
to do is have a macro enter a cell of the end-user's choice and delete
the last character in that cell. I have tried to all sorts of things
including SENDKEY but the problem is it deletes the entire contents of
the active cell...I just need a macro to work as a backspace to delete
the last character entered...any ideas? Any help is much appreciated!!!
Thanks so much!

Example...

CELL ORINGAL TEXT = "Buttons"
=========================
Macro ran once.. = "Button"
Macro ran twice.. = "Butto"
Macro ran trice.. = "Butt"
and so on...

Perhaps something like:

---------------------------
Sub DelLastChar()
If Len(Selection.Text) > 0 Then
Selection.Value = Left(Selection.Text, Len(Selection.Text) - 1)
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top