Solved

formatting

Posted on 2011-02-24
3
293 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

772 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