Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to edit this code to delete rows if cells in column B are empty AND if
the corresponding cell in Column A is MC, Disc or Visa, is that possible? Sub delRows() Range("B:B").SpecialCells(xlCellTypeBlanks).Entire Row.Delete End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub ClearData()
Dim iRows As Long Dim i As Long Dim rng As Range iRows = Cells(Rows.Count, "A").End(xlUp).Row Columns(1).Insert Rows(1).Insert Range("A1").Value = "Temp" Range("A3").Resize(iRows - 1).Formula = "=AND(C2="""",OR(B2={""MC"",""Disc"",""Visa""} ))" Range("A1").Resize(iRows + 1).AutoFilter field:=1, Criteria1:=True Set rng = Range("A1").Resize(iRows + 1).SpecialCells(xlCellTypeVisible) rng.EntireRow.Delete Columns(1).Delete End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "JOUIOUI" wrote in message ... I need to edit this code to delete rows if cells in column B are empty AND if the corresponding cell in Column A is MC, Disc or Visa, is that possible? Sub delRows() Range("B:B").SpecialCells(xlCellTypeBlanks).Entire Row.Delete End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting several rows with given criteria | Excel Discussion (Misc queries) | |||
Deleting rows by specified criteria for duplicates | Excel Discussion (Misc queries) | |||
Deleting Rows w/ Specific Criteria | Excel Discussion (Misc queries) | |||
Help - Deleting Rows on Text Criteria | Excel Programming | |||
Deleting rows based on criteria | Excel Programming |