Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the below code in a macro that by itself runs great. I want to stop it
at row 8. The data starts in row 9 and ends when it ends - the amount of rows always varies. I have tried using different "Do", "Do Until" but have not been successful. Any help would be greatly appreciated. Darryl Range("a8").Select Dim lastrow As Long, formRow As Long Dim i As Long lastrow = Cells(Rows.Count, 1).End(xlUp).Row formRow = lastrow + 1 For i = lastrow To 2 Step -1 If Cells(i, 31) < Cells(i - 1, 31) Then Cells(formRow, "K").Formula = "=SubTotal(9," & _ "K" & i & ":K" & formRow - 1 & ")" Rows(i).insert shift:=xlShiftDown formRow = i End If Next |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting rows inbetween rows of data ? | Excel Discussion (Misc queries) | |||
Copying & Inserting Rows w/o Affecting other Rows Etc. | Excel Worksheet Functions | |||
Inserting Blank rows after every row upto 2500 rows | Excel Worksheet Functions | |||
Why is inserting rows throwing off my hidden rows | Excel Programming | |||
Inserting multiple rows in excel with data in consecutive rows | Excel Programming |