View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
IanC[_2_] IanC[_2_] is offline
external usenet poster
 
Posts: 157
Default Adding a blank row between values

Sub test()

c = 1 ' for column A
For r = 1000 To 2 Step -1 ' for data starting at row 1 and ending at row
1000
If Cells(r, c).Value < Cells(r - 1, c).Value Then
Rows(r).Insert
r = r - 1
End If
Next r

End Sub


--
Ian
--
"Rick" wrote in message
...
I would like to be able to automate the row adds.

rows 1-3 are alike, rows 4-9 are alike, row 10 is alone, rows 11-15 are
alike. How do I add blank rows between these groups of varying values
without
selecting the top row in each value and performing an insert row?

some of these sheets have hundreds of values.

i.e. what i have:

001
001
002
002
002
003
003
003
003

What I want:
001
001

002
002
002

003
003
003
003

etc...

thanks in advance
Rick