Dear Excel Masters,
I wanna ask "do loop" formula. The formula which i have used, But it still debug. Here is my formula :
Sub TEst()
Dim c As Range
Set c = Range("D4:D24")
Do Until c.Value = "21"
If c.Value <> 21 Then
c.EntireRow.Delete
End If
Loop
End Sub
so i want excel to delete entire row between D4:D24 if not meet the criteria, but if it meets with criteria excel will stop to search data. What's wrong with my formula?
I wanna ask "do loop" formula. The formula which i have used, But it still debug. Here is my formula :
Sub TEst()
Dim c As Range
Set c = Range("D4:D24")
Do Until c.Value = "21"
If c.Value <> 21 Then
c.EntireRow.Delete
End If
Loop
End Sub
so i want excel to delete entire row between D4:D24 if not meet the criteria, but if it meets with criteria excel will stop to search data. What's wrong with my formula?