I am fairly new to macros in excel however I have done programming before. My biggest problem is figuring out the syntax for everything. So wondering if you guys could give me a hand.
What I need is to check to see if a cell in a column matches one of several different strings. If it does then I need to change another cell in the same row but different column to say DELETE. If it does not contain that string then I simple delete it So far I have this
Sub Loop_WIP()
Dim First As Long
Dim Last As Long
Dim Lrow As Long
First = .UsedRange.Cells(1).Row
Last = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = Last To First Step -1
With .Cells(Lrow, "A")
If Not IsError(.Value) Then
If .Value = "ItemA" or "ItemB" or "ItemC" Then
Change Value of Column B same Row
Else
.EntireRow.Delete
End If
End With
Next Lrow
End With
End Sub
Alternatively I could delete all of the un needed rows then go back with another macro to change all of row B to say DELETED. I still face the problem of not knowing how to format a cell change.
Bookmarks