Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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
up vote 2 down vote accepted

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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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