Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting the text without deleting the formula | Excel Worksheet Functions | |||
Deleting cell data without deleting formula | Excel Discussion (Misc queries) | |||
deleting values in a worksheet without deleting the formulas | Excel Worksheet Functions | |||
how prevent formula in cell from deleting when deleting value???? | New Users to Excel | |||
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content | Excel Programming |