Hi,
I've been struggling with this for a few days now and still can not come up with the fix. I have the code below that is supposed to look at the contents of cell B1 and then delete all rows in column B whose cell content matches the entry in cell B1. I'm sure this may be a simple fix for most, but I'm still a bit of a novice with working with this stuff.
Basically, I have another macro that goes to the applicable worksheet and activates cell B1 first. The problem with this code is that it deletes the first row because it is also a match.
Sub DeleteMatchingRows()
Dim LR As Long, i As Long
With Sheets("Tracker")
LR = .Range("B" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If .Range("B" & i).Value = ActiveCell.Value Then .Rows(i).Delete
Next i
End With
End Sub
Any help would be greatly appreciated.
Thanks,
Steve
Bookmarks