Solved

formatting

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
highlight duplicate entry 16 29
DBF to ... Converter 5 40
Consolidate xl 2010 worksheets with text 2 23
nested if statement in excel help 4 0
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now