Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub delete_sme_rows()
Dim r As Range, j As Long Set r = ActiveSheet.UsedRange j = r.Rows.Count + r.Row Set rdel = Cells(j, "A") For i = 1 To j - 1 If Cells(i, "C").Value = "SME" Then Set rdel = Union(rdel, Cells(i, "A")) End If Next rdel.EntireRow.Delete End Sub Looks in column C -- Gary's Student "DeanT" wrote: I have the below sheet and wish to write macro to delete entire rows that contain "SME" in category column. The size of sheet will vary as will the location of the rows within the sheet. I'm guessing I need a relative macro, but I can't come up with one that works. A B Category D xxx xxx PM y xgy xxx SME z sss xxx PM y ccc nnn SME d Thanks for your help. dean |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to avoid deleteing certain rows? | Excel Programming | |||
Deleteing some Rows | Excel Discussion (Misc queries) | |||
Deleteing Rows | Excel Programming | |||
Deleteing Duplicate Rows??? | Excel Programming | |||
Deleteing Rows | Excel Programming |