0

I am fairly new to code and haven't found a post covering this so any help would be great.

Basically am trying to review a large number of rows and delete a cell range in a row if a specified cell in the row does not equal a certain character or if a specified cell equals "TEXT". The furthest I have come is entire row deletion based on the specified criteria to delete.

Currently:

Dim dblrow As Double
Dblrow = 6
Do while (Cells(dblrow,1).Value <> "")

If Cells(dblrow, 23).Value <> "0" _
Or Cells(dblrow,5).Value = "TEXT" Then

Rows(dblrow).Select
Selection.Delete

Thank you

BigBen
  • 46,229
  • 7
  • 24
  • 40
  • So do you want to delete the cell, or clear the cell? – BigBen Jan 23 '20 at 15:24
  • Hi BigBen, I suppose clearing the cell would have the same outcome. – Newtocode Jan 23 '20 at 15:26
  • 2
    You can delete the all the relevant rows using an Autofilter. Much better than looping. You may want to see [delete row based on condition](https://stackoverflow.com/questions/11317172/delete-row-based-on-condition) – Siddharth Rout Jan 23 '20 at 15:40

0 Answers0