ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I get Excel to enter a cell and delete the last character typed? (https://www.excelbanter.com/excel-programming/380404-how-do-i-get-excel-enter-cell-delete-last-character-typed.html)

[email protected]

How do I get Excel to enter a cell and delete the last character typed?
 
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...


Ron Rosenfeld

How do I get Excel to enter a cell and delete the last character typed?
 
On 2 Jan 2007 16:18:10 -0800, wrote:

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
------------------------


--ron


All times are GMT +1. The time now is 07:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com