Need Help Deleting

A

alexm999

I need a quick macro that will help me delete all cells in Column A tha
have a # in it and in Column C I need all the cells that have the wor
NAME in it to be deleted...

Also, one more thing, in columb B i have customer numbers that star
with the Letter B and have a 1 or 2 or 3 digit number proceeding it (i
B123, B2, B30, etc...) is there a way I can find all instances of B..
and have it automatically deleted
 
T

Tom Ogilvy

Bob already gave you the basic code to do it. You just need to adapt it.

Sub AAA()
Dim oFound As Range
Dim firstaddress

varr = Array("B*", "*#*", "*name*")
For i = LBound(varr) To UBound(varr)
firstaddress = ""
Set oFound = Cells.Find(varr(i), _
LookIn:=xlValues, LookAt:=xlWhole)
If Not oFound Is Nothing Then
firstaddress = oFound.Address
Do
'oFound.Delete Shift:=xlShiftUp
oFound.ClearContents
Set oFound = Cells.FindNext(oFound)
Loop While Not oFound Is Nothing
End If
Next

End Sub
 
Top