Here's a macro you can assign to a custom macro button on your toolbar. Select the cell that contains the text you want deleted and then run this macro:
Dim x As String
' Abort if a range isn't selected
If TypeName(Selection) <> "Range" Then
MsgBox "Please select a single cell", vbOKOnly + vbInformation, "Invalid Range Selection"
If Selection.Cells.count > 1 Then
MsgBox "Please select a single cell", vbOKOnly + vbInformation, "Invalid Range Selection"""
On Error GoTo endmacro
x = ActiveCell.Value
If x = "Error 2042" Then x = ActiveCell.Formula
If x = Empty Then
intResponse = MsgBox("The current cell is empty. Do you wish to delete all rows with an empty cell in the current column?", vbOKCancel, "Delete Rows If Same")
If intResponse = vbCancel Then
intResponse = MsgBox("This macro will delete all rows with " & x & " in the current column", vbOKCancel, "Delete Rows If Same")
If intResponse = vbOK Then
.Calculation = xlCalculationManual
.ScreenUpdating = False
.AutoFilter Field:=1, Criteria1:=x
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Using the same macro, instead of delete row, I want it to delete a row(s) if they dont have a number in them (the number is random), but the cell will either have a number or have a -- or be blank or have letters so my only criteria is that there be a number in the row otherwise delete it.