View Single Post
  #1   Report Post  
Robert
 
Posts: n/a
Default Dedrie, FORMATTING SUBTOTALS

In response to your recent query, Ron de Bruins following code will definately
help you.

-- Alt-F11 to open the VBA editor
Insert module from the menubar
Paste the sub
Alt-Q to go back to excel

Alt-F8
Select test
Run

Sub test()
Dim Rng As Range
Dim findstring As String
findstring = "subtotal"
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