Hi guys,
I found this code buried in the forums and I don't have the foggiest idea how to alter it to suit my needs.
I want to delete each row where the value in column B is "X"
Also how do I actually use this once it is altered?
Thanks guys,
Ben
I found this code buried in the forums and I don't have the foggiest idea how to alter it to suit my needs.
I want to delete each row where the value in column B is "X"
Also how do I actually use this once it is altered?
Thanks guys,
Ben
Sub myDeleteRows()
Dim MyCol As String
Dim MyVal As Variant
Dim i As Integer
MyCol = InputBox("column to look through", "Column Search", "A")
MyVal = InputBox("Value to look for", "search value", 0)
For i = 1 To Range(MyCol & "65536").End(xlUp).Row Step 1
If Application.WorksheetFunction.CountIf(Range("A" & i & ":AZ" & i), MyVal) > 0 Then
Range("A" & i).EntireRow.Delete
End If
Next i
End Sub
Last edited: