View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Add 5 blank rows after Word

Try this for column A

Sub test2()
Dim Rng As Range
Dim findstring As String
findstring = "Books"
Set Rng = Range("A:A").Find(What:=findstring, After:=Range("A" & Rows.Count), _
LookAt:=xlPart)
While Not Rng Is Nothing
Rng.Offset(1, 0).Resize(5, 1).EntireRow.Insert
Set Rng = Range("A" & Rng.Row + 1 & ":A" & Rows.Count) _
.Find(What:=findstring, After:=Range("A" & Rows.Count), _
LookAt:=xlPart)
Wend
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Elaine" wrote in message ...
How do I insert 5 blanks after the word Books has been used.

I have about 6000 rows in my spreadsheet and there was supposed to be a
total cost. In col A there are lots of blank rows except where words such as
"Books" or "Total Books" or sometimes "Text Books" appear.

Where the word "Book" appears, I would like to add 5 rows below that word.
Thank you.

--Elaine