Nerdalert314

New Member
Joined
Mar 28, 2018
Messages
23
Good afternoon,

I am trying to create a Macro to add a blank cell in-between line. Every month when we do this there is no way to know how many lines we will have. Manually doing these I do the following:
Number the cells next to the date and auto fill all the way down. Copy the numbers. Paste them directly under the last number. Filter smallest to largest. I have included an example below that you can hopefully follow along with. Any suggestions would be great. Thank you!

SAMPLE 1X # OF CELLS
SAMPLE 2
SAMPLE 3
SAMPLE 4
SAMPLE 5
SAMPLE 6
SAMPLE 7
SAMPLE 8
SAMPLE 9
SAMPLE 10
SAMPLE 11 # THE CELLS WITH AUTOFILL
SAMPLE 22
SAMPLE 33
SAMPLE 44
SAMPLE 55
SAMPLE 66
SAMPLE 77
SAMPLE 88
SAMPLE 99
SAMPLE 1010
SAMPLE 11 Paste the # under the last #
SAMPLE 22
SAMPLE 33
SAMPLE 44
SAMPLE 55
SAMPLE 66
SAMPLE 77
SAMPLE 88
SAMPLE 99
SAMPLE 1010
1
2
3
4
5
6
7
8
9
10
SAMPLE 11 Sort smallest to largest by column B
1
SAMPLE 22
2
SAMPLE 33
3
SAMPLE 44
4
SAMPLE 55
5
SAMPLE 66
6
SAMPLE 77
7
SAMPLE 88
8
SAMPLE 99
9
SAMPLE 1010
10

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
How about
Code:
Sub AddBlanks()
   Dim i As Long
   For i = Range("A" & Rows.count).End(xlUp).Row To 2 Step -1
      Rows(i).Insert
   Next i
End Sub
This assumes your data is in col A
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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