32CARDS
Board Regular
- Joined
- Jan 1, 2005
- Messages
- 123
I have a list of rows to delete in Sheets("Sort").,
but the list has grown in Sheets("CONTROLS").
The code below works fine when there was up to 3 rows of data which is not required. So I just added and extra line of code.
How can I use a more convenient method of deleting rows as I add to the list in Sheets("CONTROLS") from Range V1 to as many as required ?
Sheets("Sort")'s data has duplicate names ( not sequential ) and can go as far as 500 + rows deep.
Thanks
but the list has grown in Sheets("CONTROLS").
The code below works fine when there was up to 3 rows of data which is not required. So I just added and extra line of code.
How can I use a more convenient method of deleting rows as I add to the list in Sheets("CONTROLS") from Range V1 to as many as required ?
Sheets("Sort")'s data has duplicate names ( not sequential ) and can go as far as 500 + rows deep.
Thanks
Code:
Sub DelCustomRows2()
Sheets("Sort").Select
[D3].Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value = Sheets("CONTROLS").Range("V1").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V2").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V3").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V4").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V5").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V6").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V7").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V8").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V9").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V10").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V11").Value Or _
ActiveCell.Value = Sheets("CONTROLS").Range("V12").Value Then
ActiveCell.EntireRow.Delete
ActiveCell.Offset(-1, 0).Select
End If
ActiveCell.Offset(1, 0).Select
DoEvents
Loop
DoEvents
[A2].Select
Application.ScreenUpdating = True
End Sub