Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not quite sure what you want cuz I would put at the top but this code
will find the word "total" and insert a row just before that row. Sub findtotal() x = Columns(1).Find("total").Row Rows(x).Insert End Sub this does the same Sub findtotal1() Rows(Columns(1).Find("total").Row).Insert End Sub -- Don Guillett SalesAid Software "SharonInGa" wrote in message ... I want to insert one row after finding a subtotal. The code below is inserting five rows. ???? '------------------------------------- Dim i As Integer 'i = 1 'Do Until IsEmpty(Cells(i, 1)) ' Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ ' :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _ ' False, SearchFormat:=False).Activate ' ActiveCell.Offset(1, 0).Range("A1").Select ' Selection.EntireRow.Insert ' 'i = i + 1 'Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Variable Number of Rows; With Loop | Excel Worksheet Functions | |||
loop to insert rows | Excel Programming | |||
loop to insert rows | Excel Programming | |||
Cant run insert row through loop | Excel Programming | |||
help on insert rows and fill down loop until end | Excel Programming |