Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following code to delete all rows that do
not contain a 1 in column C. It works on ALL rows in a worksheet. I need it to only work within a selection (A2:H128). I can't seem to get anything to work. Any suggestions? TIA Dim RowNdx1 As Long Dim LastRow1 As Long Sheets("TEST").Select LastRow1 = ActiveSheet.Cells(Rows.Count, "C").End (xlUp).Row For RowNdx1 = LastRow1 To 2 Step -1 With Cells(RowNdx1, "C") If .Value < 1 Then Rows(RowNdx1).Delete End If End With Next RowNdx1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop | Excel Discussion (Misc queries) | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Worksheet_Change - loop within a loop | Excel Programming | |||
need a loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |