I don't get it, I just don't get it. This code works to delete a row based on criteria input from a userform:
Range("a1:a74").Select
For Each cl In Selection
If cl.Text = ComboBox1.Text Then
cl.EntireRow.Delete
End If
Next
I thought my code search would produce something similar, but it doesn't. I don't know how to modify the code above to fit my needs, if that is even at all possible.
I tried modifying the code below from a webpage without success:
Dim DeleteValue As String
Dim rng As Range
DeleteValue = ("Randomizer!d3")
' This will delete the rows with "ron" in the Range("A1:A100")
With ActiveSheet
Sheet9.Range("A1:A100").AutoFilter Field:=1, Criteria1:=DeleteValue
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete
End With
.AutoFilterMode = False
End With
Where "Randomizer!d3" is the criteria I wish to search within another sheet and have the row deleted if it finds it.
Bookmarks