Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete entire row based on cell content
I would like to have a macro run down a column of figures,
deleting rows that contain the number 1. I'm a novice so I have trouble instructing it to stop when the data ends.... TIA! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete entire row based on cell content
In a standard module insert:
Sub DeleteRowWith1() Dim MyRange As Range Set MyRange = Range("D:D") For Each c In MyRange If IsEmpty(ActiveCell.Value) Then Exit Sub Else If c.Value = 1 Then ActiveCell.EntireRow.Delete End If End If ActiveCell.Offset(1, 0).Select Next c End Sub "PHIL" wrote in message ... I would like to have a macro run down a column of figures, deleting rows that contain the number 1. I'm a novice so I have trouble instructing it to stop when the data ends.... TIA! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete entire row based on cell content
Sub deleterowwithoneinit()
' ' Macro1 Macro ' Macro recorded 3/12/2003 by me ' For Each c In Worksheets("Sheet1").Range("A:A") If c.Value = 1 Then c.EntireRow.Delete End If Next End Sub Wazza McG |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Specify a row based on data from a cell to delete entire row..... | Excel Discussion (Misc queries) | |||
How Do I Condition A Entire Row, Based On The Content Of A Single | New Users to Excel | |||
Delete Row based off cell content | Excel Discussion (Misc queries) | |||
how do I highlight an entire row based on the value of its content | Excel Discussion (Misc queries) | |||
Hide/Delete entire rows based in the content of one cell | Excel Discussion (Misc queries) |