Evaluating Empty Cells

  • Thread starter Thread starter halem2
  • Start date Start date
H

halem2

I have a short sub evaluating cell contents. If it is diffrent fro
"OT" then delete entire row. It works fine but I need to make it sto
if cell is empty :rolleyes:

Sub Julie()
Cells(6, 6).Select
Do
If ActiveCell <> "OT" Then
Selection.EntireRow.Delete
Else: ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""

End Sub

thank
 
Sub Julie()
Dim cRows As Long
Dim i As Long

cRows = Cells(Rows.Count, 6).End(xlUp).Row
For i = cRows To 6 Step -1
If Cells(i, 6).Value <> "OT" Then
Cells(i, 1).EntireRow.Delete
End If
Next i

End Sub
 
hi again
excuse me
that should be
LOOP while not isempty(activecell)
I put my criteria after the do and was running on habit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top