Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatically insert blank rows in excel

Status
Not open for further replies.

georgeous

Programmer
Jul 11, 2001
38
GB
I have a spreadsheet looking something like this.
I want to automatically insert a blank line after every row with 'Step 3' in it.
How can I do this?


xxx123456........STEP 1....etc etc
xxx123456........STEP 2....etc etc
xxx123456........STEP 3....etc etc
xxx789101........STEP 2....etc etc
xxx789101........STEP 3....etc etc
xxx787710........STEP 3....etc etc
 
hey georgeous george ;-)

(out of TEN plays-on-words...

No pun intendid!)

Why take a perfectly good LIST (and I assume that it's a GOOD LIST) and srew it up!? By that I mean that blank rows and columns within lists make PROCESSING the list much harder.

So, you want to spread things out or sumthin like that? Why not change the ROW HEIGHT? I dunno?



Skip,
Skip@TheOfficeExperts.com
 
hey georgeous george ;-)

(out of TEN ostensibly humerous plays-on-words...

No pun intendid!)

Why take a perfectly good LIST (and I assume that it's a GOOD LIST) and srew it up!? By that I mean that blank rows and columns within lists make PROCESSING the list much harder.

So, you want to format for emphasis out or sumthin like that? Why not change the ROW HEIGHT? I dunno?
Code:
Sub Step3RowHeight()
    With ActiveSheet.UsedRange
      For r = .Row To .Row + .Rows.Count - 1
        With Cells(r, 1)
          If .Value Like "*STEP 3*" Then
            .EntireRow.RowHeight = .RowHeight * 2
            .VerticalAlignment = xlTop
          End If
        End With
      Next
    End With
End Sub
:)



Skip,
Skip@TheOfficeExperts.com
 
"The powers that be" do not like the fact that it is all clumped together because it is "difficult to read"
So they want the lines to be seperated out.

 
Well how does this solution NOT meet that requirement?

And...

it also leaves your list intact in the event that "the powers that be" ask you to get some answers out of your list that require list processing techniques.

:)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top