Reputation: 7
This is probably pretty simple to do but i'm still not totally sure how. I need a button that deletes selected text in excel, pretty much the same way as you would select a text and press delete on your keyboard.
Upvotes: 0
Views: 2665
Reputation: 19367
You can add a button to the worksheet from the Developers tab, using a simple Form Control
. Selection.Clear
or Selection.ClearContents
will.. clear everything, or just the contents, from the current selection:
Sub Button1_Click()
Selection.Clear
End Sub
But presumably you want to be able to use this from anywhere, not just in a specific worksheet. In which case, create the Macro first and then Customize the Quick Access Toolbar to add a button to run the macro.
Upvotes: 1
Reputation: 3988
Click on your text or cell where your text is written. Simply click del key from keyboard. or see below image for more details.
Upvotes: 1