Add Multiple Blank Rows In Microsoft Excel

Wow!  Long time without a post.

Anyway, I can’t believe that I’ve never realised how hard it is in the older version of Microsoft Excel to insert multiple blank rows.

I searched Google and found a few sites saying press F4 or buy our tools so I wrote  quick macro.

The macro asks how many rows you want to insert and then inserts that many rows ABOVE the current cursor position. (If you don’t specify a number of rows it defaults to 2).

I’ve tried it a few times and it seems to work okay.

If this may be useful to you perhaps give it a go!

Sub Macro1()
'
    Application.CutCopyMode = False
    
    Dim strHowManyRows As String
    Dim NumberOfRowsToInsert As Integer
    Dim c As Integer ' Just a counter


    strHowManyRows = InputBox(Prompt:="How many rows should I insert? (These rows will be inserted ABOVE the currently selected row)", _
          Title:="HOW MANY ROWS?", Default:="2")

          

        If strHowManyRows = "" Or _
           strHowManyRows = vbNullString Then
            
            
           NumberOfRowsToInsert = 2
        Else
    
           NumberOfRowsToInsert = Val(strHowManyRows)
    
        End If
        
        
    For c = 1 To NumberOfRowsToInsert
        Selection.Insert Shift:=xlDown
    Next c

End Sub
Advertisements

0 Responses to “Add Multiple Blank Rows In Microsoft Excel”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Blog Stats

  • 221,277 hits

Counter

ClustrMap


%d bloggers like this: