Solved

formatting

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
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…

760 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

19 Experts available now in Live!

Get 1:1 Help Now