Thread: Blank Rows
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Blank Rows

What would distinguish the end of one set from the next set?

This macro looks at Column A and at every change in value inserts a row colored
black and set to 3pt.

Sub InsertRow_At_Change()
Dim i As Long
With Application
.Calculation = xlManual
.ScreenUpdating = False
End With
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) < Cells(i, 1) Then _
Cells(i, 1).Resize(1, 1).EntireRow.Insert
With Rows(i)
.RowHeight = 3
.Interior.ColorIndex = 1
End With

Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord

On 16 Mar 2007 12:53:42 -0700, wrote:

I will definitely try this!! BUT I found another little thing that
could be a time-saver if there was a way to do it. After separating
types of product so that I can see what I have and don't have, I put
each list into a particular order. What I need to do with this is
insert a row, fill it with black, and resize it to 3pt. This isn't
the same one as what I asked about before. I have written a macro to
do all the basic formatting but this action doesn't seem to want to
work (in a separate macro.) because it wants to insert the row in the
same row. I really would like just to be able do a shortcut to
accomplish this instead of inserting, coloring, rezising then on to
the next one to do exactly the same thing.

Thanks again!!!