Disclaimer: I'm a complete VBA newbie.
I can get Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete to work in the "immediate" mode (with Cntrl-G in the macro editor) as per this post.
However, I'd like to map this behavior to a key combo. I can't get this to work:
Nor can I get this to work:
Suggestions? Do I have to declare the sub somehow? Do I have to map the macro to the sheet/workbook or something?
Thanks in advance!
(I suspect I'm missing some fundamental VBA step...)
I can get Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete to work in the "immediate" mode (with Cntrl-G in the macro editor) as per this post.
However, I'd like to map this behavior to a key combo. I can't get this to work:
Code:
Application.OnKey "+^{D}", "Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete"
Nor can I get this to work:
Code:
Application.OnKey "+^{D}", "DelRowsWithSelectedBlankCells"
Public Sub DelRowsWithSelectedBlankCells()
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
Suggestions? Do I have to declare the sub somehow? Do I have to map the macro to the sheet/workbook or something?
Thanks in advance!
(I suspect I'm missing some fundamental VBA step...)