Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I delete blank rows (rows alternate data, blank, data, etc | Excel Discussion (Misc queries) | |||
Copy rows of data (eliminating blank rows) from fixed layout | Excel Discussion (Misc queries) | |||
how to add word to the front of every word in all rows automatica. | Excel Discussion (Misc queries) | |||
Delete blank row only if 2 consecutive blank rows | Excel Programming | |||
Copying and pasting a worksheet to a blank and removing blank rows | Excel Programming |