Inserting Blank Cells

whitefeather

New Member
Joined
May 9, 2016
Messages
29
I have a simple table like

5569
3321
6347
7889

Now, I require to insert a fixed number of blank cells (say 5) after each of these populated cells. How to do so?

Thanks in advance.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG21Dec40
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
[COLOR="Navy"]For[/COLOR] n = Rng.Count To 1 [COLOR="Navy"]Step[/COLOR] -1
 Range("A" & n).Resize(5).Insert shift:=xlDown
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Assume the data is in column A, run this short macro:

Code:
Sub BlankInserter()
    Dim A As Range, i As Long, N As Long
    Dim j As Long
    
    Set A = Range("A:A")
    N = Cells(Rows.Count, "A").End(xlUp).Row
    
    For i = N To 2 Step -1
        For j = 1 To 5
            Cells(i, 1).Insert Shift:=xlDown
        Next j
    Next i
End Sub
 
Upvote 0
Assuming the values are in column "A" try this:

Code:
Sub Test()
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = Lastrow To 2 Step -1
        Rows(i).Resize(5).Insert
    Next
Application.ScreenUpdating = True
End Sub
OK
 
Upvote 0
This should also work...
Code:
[table="width: 500"]
[tr]
	[td]Sub InsertFiveRowsBetweenCells()
  With Range("A1", Cells(Rows.Count, "A").End(xlUp))
    .Cells(1).Resize(6 * .Count - 5) = Application.Transpose(Split(Join(Application.Transpose(.Cells), Space(6))))
  End With
End Sub[/td]
[/tr]
[/table]
 
Upvote 0
Solution

Forum statistics

Threads
1,214,561
Messages
6,120,245
Members
448,952
Latest member
kjurney

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top