Solved

formatting

Posted on 2011-02-24
3
308 Views
Last Modified: 2012-05-11
I have column a in a worksheet populated with about 300 lines of names.

I basically need to insert 6 blank rows after each line with a name in

so at present i have

dan
mike
steve
john

I basically need to format this sheet  as

dan





mike





steve



 etc? Any ideas how?
0
Comment
Question by:pma111
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
jppinto earned 105 total points
ID: 34969705
This should do it. Open the attached example and click on the button.

jppinto
Sub BlankRowInserter()
Dim cel As Range, rg As Range
Dim x, i As Long
Application.ScreenUpdating = False
Set rg = ActiveSheet.UsedRange.Columns(1)
For i = rg.Cells.Count To 2 Step -1
    For x = 1 To 6
        rg.Cells(i).EntireRow.Insert
    Next x
Next
Application.ScreenUpdating = True
End Sub

Open in new window

VBA-InsertBlankRows.xlsm
0
 
LVL 33

Expert Comment

by:jppinto
ID: 34969712
To install a sub in a regular module sheet:
1) ALT + F11 to open the VBA Editor
2) Use the Insert...Module menu item to create a blank module sheet
3) Paste the suggested code in this module sheet
4) ALT + F11 to return to the spreadsheet

To run a sub or macro:
5) ALT + F8 to open the macro window
6) Select the macro
7) Click the "Run" button
0
 
LVL 3

Assisted Solution

by:kraiven
kraiven earned 20 total points
ID: 34969721
Record a macro that does it for our first row and then edit it to loop 300 times.

You should find it straightforward to do but let me know if you hit any issues.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question