View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Robert Robert is offline
external usenet poster
 
Posts: 113
Default Insert a blank row (2)

Ron, Thank you very much. Your second code works but the row
insert takes place above the "Total" row. The row insert should be
below ie after ".Total" row. I shall await eagerly for your amendment.

Robert
"Ron de Bruin" wrote:

Hi Robert

Untested but try this one
I use xlPart now

Sub test2()
Dim Rng As Range
Dim findstring As String
findstring = "Total"
Set Rng = Range("A:A").Find(What:=findstring, After:=Range("A" & Rows.Count), LookAt:=xlPart)
While Not Rng Is Nothing
Rng.EntireRow.Cells.Font.Bold = True
Rng.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



"Robert" wrote in message ...
Dear Ron,
Your code a while earlier works beautifully only if "Total" appears.
My Totals are created by a recorded macro DataSubtotal and is therefore
"......Total".
How should the resulting code be modified to (1) (if possible) to
bold the entire Total Line (now only the break identifier is Bold),
(2) Insert a blank row after each line having the "........... Total").


Thank you.
--
Robert