1

Tried to create a macro in Excel to insert a row:

Sub InsertRow()
'
' InsertRow Macro
'
' Keyboard Shortcut: Ctrl+Shift+I
'
    Selection.EntireRow.Insert
End Sub

However, this does not insert a new row without first manually selecting a row.

Every solution I've found requires that a row be highlighted before inserting a new row.

See also: http://www.shortcutworld.com/en/win/Excel_2010.html

How would you create a shortcut key (e.g., Ctrl+Shift+J) to highlight the current row and insert a new row?

Thank you!

Update

Looks like Shift+Space highlights the current row.

2

Solution...

  1. Create a macro:

    Sub InsertRow()
    '
    ' InsertRow Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+J
    '
        ActiveCell.EntireRow.Select
        Selection.EntireRow.Insert
    End Sub
    
  2. Assign the macro to a keyboard shortcut.

1

How about putting the insert row command in the quick access toolbar and calling it with AltNumber?

You could also use AltIR for your first insert and then F4 to repeat the insert, i.e. insert a new row above your selection (no need to select the whole row first). You can move your selection around and still use it.

  • The Alt-I R is slower than Ctrl+Shift+J because there is a key release that must happen first. The Alt-Number might work; I have a funny feeling it would prompt for the number of rows to enter, though. – Dave Jarvis Oct 31 '12 at 22:43
  • Shift+Space / Ctrl+Shift+= – nutsch Oct 31 '12 at 22:49
  • Yes, those work, but I'm looking for a single shortcut, not two shortcuts in combination. – Dave Jarvis Oct 31 '12 at 22:52
  • For example, hold down Ctrl+Shift and type J as often as needed; it's very fast. – Dave Jarvis Oct 31 '12 at 23:11
  • 1
    If you want to do it often, just use F4\ – nutsch Oct 31 '12 at 23:26

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.