Here is one way to do it that should be faster than iteratring every row in Column C...I tried the following but I am not sure How to change this to find FLASE in Column C
Sub Macro1()
Last = Cells(Rows.Count, "COLUMN").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "COLUMN").Value) = "FALSE" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub
Thanks
Sub DeleteFalseRows()
Dim UnusedCol As Long, LastRow As Long
UnusedCol = Cells.Find(What:="*", SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, LookIn:=xlFormulas).Column + 1
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Cells(1, UnusedCol).Resize(LastRow) = Evaluate("IF(C1:C" & LastRow & "=FALSE,""X"","""")")
On Error Resume Next
Columns(UnusedCol).SpecialCells(xlConstants).EntireRow.Delete
On Error GoTo 0
End Sub
Sub DelRows()
Dim rngData As Range, LastRow As Long
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Set rngData = Range("C1:C" & LastRow)
rngData = Evaluate("IF(ROW(1:" & LastRow & "), (1/" & rngData.Address & ")=1)")
On Error Resume Next
rngData.SpecialCells(xlConstants, xlErrors).EntireRow.Delete
On Error GoTo 0
End Sub
See if this works (adapting Rick's idea of using SpecialCells method)
Assumes data (False/True) beginning in C1
Code:Sub DelRows() Dim rngData As Range, LastRow As Long LastRow = Cells(Rows.Count, "C").End(xlUp).Row Set rngData = Range("C1:C" & LastRow) rngData = Evaluate("IF(ROW(1:" & LastRow & "), (1/" & rngData.Address & ")=1)") On Error Resume Next rngData.SpecialCells(xlConstants, xlErrors).EntireRow.Delete On Error GoTo 0 End Sub
M.
Thanks
But it deleted everything from my sheet.... nothing left.... :O save me pls