[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

formatting

Posted on 2011-02-24
3
Medium Priority
?
328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
jppinto earned 420 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 80 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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,…
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 create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

650 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