Home > Excel Tutorial > Adding Blank Rows with VBA Code – 2

Adding Blank Rows with VBA Code – 2

Insert  blank rows between filled rows with VBA code

You can add 1, 2 or 3 rows with checkbox in this template.You can remove those rows with checkbox.

Examples of code :

Sub Addrow2()
Dim a As Byte, sat As Byte
[A2].Select
a = 3: sat = 2
While ActiveCell.Value <> “”
ActiveSheet.Rows(ActiveCell.Row & “:” & sat + ActiveCell.Row – 1).Insert Shift:=xlDown
ActiveCell.Offset(a, 0).Select
Wend
a = Empty: sat = Empty
End Sub

Add blank rows

Download Here

  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: