ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Rows Based On Content (https://www.excelbanter.com/excel-programming/313273-delete-rows-based-content.html)

halem2[_38_]

Delete Rows Based On Content
 

Hi folks:

I'm tryint to build a code that would select a cell, check if th
content matches one of two options and if so, move down to the nex
cell, else delete the row. this is what I have:

Do
If ActiveCell = "OPERATOR ID" Or ActiveCell = "JC" Then
ActiveCell.Offset(1, 0).Select
Else: Selection.EntireRow.Delete
End If
Loop Until ActiveCell = "*"

It's working but only for the "JC" not the Op ID. All cells ar
formatted as text.

Any thoughts??? :confused: :eek

--
halem
-----------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993
View this thread: http://www.excelforum.com/showthread.php?threadid=26848


Myrna Larson

Delete Rows Based On Content
 
It's looking for the literal text OPERATOR ID. Is that what you want?

On Tue, 12 Oct 2004 09:02:12 -0500, halem2
wrote:


Hi folks:

I'm tryint to build a code that would select a cell, check if the
content matches one of two options and if so, move down to the next
cell, else delete the row. this is what I have:

Do
If ActiveCell = "OPERATOR ID" Or ActiveCell = "JC" Then
ActiveCell.Offset(1, 0).Select
Else: Selection.EntireRow.Delete
End If
Loop Until ActiveCell = "*"

It's working but only for the "JC" not the Op ID. All cells are
formatted as text.

Any thoughts??? :confused: :eek:




All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com