![]() |
Evaluating Empty Cells
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 -- halem ----------------------------------------------------------------------- halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993 View this thread: http://www.excelforum.com/showthread.php?threadid=26697 |
Evaluating Empty Cells
hi
try this do while not isempty(activecell) or -----Original Message----- I have a short sub evaluating cell contents. If it is diffrent from "OT" then delete entire row. It works fine but I need to make it stop 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 thanks -- halem2 ---------------------------------------------------------- -------------- halem2's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=266973 . |
Evaluating Empty Cells
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 -- HTH RP "halem2" wrote in message ... I have a short sub evaluating cell contents. If it is diffrent from "OT" then delete entire row. It works fine but I need to make it stop 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 thanks -- halem2 ------------------------------------------------------------------------ halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=266973 |
Evaluating Empty Cells
hi again
excuse me that should be LOOP while not isempty(activecell) I put my criteria after the do and was running on habit. -----Original Message----- I have a short sub evaluating cell contents. If it is diffrent from "OT" then delete entire row. It works fine but I need to make it stop 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 thanks -- halem2 ---------------------------------------------------------- -------------- halem2's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=266973 . |
All times are GMT +1. The time now is 04:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com