Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter, one other thing. I don't see an offset or some other command so that
if Total is on one line and Grand Total is in the next, then lines will not be inserted. Thanks. "Peter T" wrote: Hi Elaine, Dim RngCell As Range Dim rCell As Long 'code If InStr(1, LCase(RngCell.Value), "total") 0 Then If InStr(1, LCase(RngCell.Value), "grand total") = 0 Then Rows(rCell + 1 & ":" & rCell + 2).Insert End If End If could also AND the two conditions Regards, Peter T "Elaine" wrote in message ... I would like to insert two rows after the word Total appears in Column A except at the bottom of the working range as I don't want to insert lines between Total and Grand Total. Dim RngCell as Range Dim rCell as Long If InStr(1, LCase(RngCell.Value), "total") 0 then Rows(rCell + 1 & ":" & rCell + 2).Insert How do I tell the above code not to insert two rows if Grand Total (with a space) appears in the row below total? Thanks for your help. --Elaine |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert rows (1 to 4) if the cell value equals a fixed word | Excel Discussion (Misc queries) | |||
Insert rows (1 to 4) if the cell value equals a fixed word. | Excel Programming | |||
Autoatically insert blank row above total when no more rows | Excel Programming | |||
Insert Grand total at the end | Excel Programming | |||
Change Word Total and Grand Total | Excel Programming |