Hi All,
I have some data which I need to sort through and as part of my macro, I want to delete rows which contain certain text. So for example, in column G if the word "Late" appears in cell G50, I want to delete row 50. From other threads I have found the below code which works, but I now want to expand this to include another column, do you know how I can do this?
End point:
Column G will have no cells in it which contain the word "Late"
Column M will have no cells in it which contain the word "Cash"
Thanks!
Andy
Dim c As Range
Dim SrchRng
Set SrchRng = ActiveSheet.Range("G2:G1000")
Do
Set c = SrchRng.Find("Late", LookIn:=xlValues)
If Not c Is Nothing Then c.EntireRow.Delete
Loop While Not c Is Nothing
I have some data which I need to sort through and as part of my macro, I want to delete rows which contain certain text. So for example, in column G if the word "Late" appears in cell G50, I want to delete row 50. From other threads I have found the below code which works, but I now want to expand this to include another column, do you know how I can do this?
End point:
Column G will have no cells in it which contain the word "Late"
Column M will have no cells in it which contain the word "Cash"
Thanks!
Andy
Dim c As Range
Dim SrchRng
Set SrchRng = ActiveSheet.Range("G2:G1000")
Do
Set c = SrchRng.Find("Late", LookIn:=xlValues)
If Not c Is Nothing Then c.EntireRow.Delete
Loop While Not c Is Nothing