![]() |
Need Help Deleting
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 -- Message posted from http://www.ExcelForum.com |
Need Help Deleting
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 -- Regards, Tom Ogilvy "alexm999 " wrote in message ... I need a quick macro that will help me delete all cells in Column A that have a # in it and in Column C I need all the cells that have the word NAME in it to be deleted... Also, one more thing, in columb B i have customer numbers that start with the Letter B and have a 1 or 2 or 3 digit number proceeding it (ie B123, B2, B30, etc...) is there a way I can find all instances of B... and have it automatically deleted? --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 08:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com