Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub Delete_Row()
'looks only at Column A Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim lastrow As Long, r As Long lastrow = ActiveSheet.UsedRange.Rows.Count For r = lastrow To 1 Step -1 If Cells(r, 1).Value < "Bad" Then Rows(r).Delete Next r Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Tue, 6 May 2008 11:20:08 -0700, Cue wrote: I'm tring to delete a row that has a cell that contains words but does not contain a specific "text". Ex. Cell A2 = Jill - Good I want to delete Row 2 becasue Cell A2 does not contain "Bad". The Macro is following: Sub Delete Row() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim lastrow As Long, r As Long lastrow = ActiveSheet.UsedRange.Rows.Count For r = lastrow To 1 Step -1 If Cells(r, 3).Value < "text" Then Rows(r).Delete Next r Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub Can somebody show me what is missing or needed to accomplish this? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
Macro to Replace/Delete Text Using "Watchword" List? | Excel Discussion (Misc queries) | |||
USING EXCEL, delete all text right of the "!" symbol | Excel Worksheet Functions | |||
Excel: Changing "numeric $" to "text $" in a different cell. | Excel Worksheet Functions | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) |