An Excel Shortcut (ALT+SHIFT+D) to Delete the Row of Currently Selected Cell
You searched, and they tell you
- Press SHIFT+ SPCBAR to select row (2x if necessary 😊)
- Press CTRL+- to delete the row
And you're thinking - can't you tell that I one ONE shortcut to fire and forget and get the J done.
Fortunately for us (else we'd have spent $5 on Upwork 😊) this guy figured it out.
So, all you do is
- Put the subroutine (that your shortcut will call) definition in your Personal Macro Workbook
- Put the shortcut definition in your Personal Macro Workbook
and you're done.
In detail :
This assumes that you already have a Personal Macro Workbook. If not, then watch one of the thousands of videos that show you how to get one free of charge.
- In Excel, press ALT + F11 to open the Microsoft Visual Basic for Applications Editor and go to your PERSONAL.XLSB and find a module that you think is ok to add code to. Add this code :
Sub Delete_Active_Row()
Rows(ActiveCell.Row).Delete
End Sub
- Now, in the PERSONAL.XLSB, go to the Microsoft Excel Objects section and open the "ThisWorkbook" object.
And ensure you have this (where you are allowed to have "more" than just this within the Sub 😊)
Private Sub Workbook_Open()
Application.OnKey "+%d", "PERSONAL.XLSB!Delete_Active_Row" 'ALT+SHIFT+D
End Sub
You get the idea 😊 You can define other shortcuts too, but you need this at the minimum to get ALT + SHIFT + D to do what we're trying to do here.. Thanks Jakub Dabrowski for telling me why "%+d" will not work 😊
Comments
Post a Comment