Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For RowNdx = LastRow To 2 Step -1
This loop works from the bottom row, up. So LastRow To 2 will stop after doing row 2. Mike F "J.W. Aldridge" wrote in message ups.com... one more thing.... If I wanted the macro to start at A2 (instead of A1)? (row a1 has my headers) Sub Apples() Dim LastRow As Long Dim RowNdx As Long LastRow = Cells(Rows.Count, "A").End(xlUp).Row '<change column letter if desired For RowNdx = LastRow To 1 Step -1 '<change '1' to ending row if desired If Left(Cells(RowNdx, "A"), 4) < "PCPB" Then Rows(RowNdx).Delete End If Next RowNdx End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Delete rows with numeric values, leave rows with text | Excel Programming | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |