Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about removing "misery" something like this non-looping way instead?
Sub StayHappy() Dim Word As String Word = "misery" Columns("A").AutoFilter Criteria1:=Word, Field:=1, VisibleDropDown:=False Range("A1:A" & ActiveSheet.UsedRange.Rows.Count).Offset( _ Abs(Range("A1").Value < Word)).EntireRow.Delete ActiveSheet.AutoFilterMode = False End Sub -- Rick (MVP - Excel) "Gary''s Student" wrote in message ... Suppose we want to remove "misery": Sub StayHappy() Dim n As Long Dim i As Long n = Cells(Rows.Count, "A").End(xlUp).Row For i = n To 1 Step -1 If Cells(i, "A").Value = "misery" Then Rows(i).Delete End If Next End Sub -- Gary''s Student - gsnu200848 "Bishop" wrote: I have a spreadsheet sorted by column A. I need a procedure that will find every cell with a specific value (they will all be grouped together because of the sort) in column A and delete every row (ever how many it is) that has that value in column A. Then I need the remaining data shifted up. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting rows meeting certain criteria in a particular column | Excel Discussion (Misc queries) | |||
Deleting Rows using a range in Column A | Excel Programming | |||
Deleting rows with no value in column A | Excel Programming | |||
Deleting rows with no value in column A | Excel Programming | |||
Deleting rows based upon the value in column D | Excel Programming |