Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi and TIA. What I'm trying to accomplish is to run code that checks column
A starting at A1. Run down until it finds the word "DeleteMe" and from that row until the end of the document delete all rows. Is that possible? Thanks for any advice and your time. -- Reggie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this macro a try...
Sub ProcessDeleteMe() Dim DM As Range With Worksheets("Sheet1") On Error GoTo Done Set DM = .Columns("A").Find(What:="DeleteMe", MatchCase:=False) Application.Intersect(.UsedRange, Range(DM, .Cells( _ .Rows.Count, "A"))).EntireRow.Delete End With Done: End Sub -- Rick (MVP - Excel) "JRSmith" wrote in message ... Hi and TIA. What I'm trying to accomplish is to run code that checks column A starting at A1. Run down until it finds the word "DeleteMe" and from that row until the end of the document delete all rows. Is that possible? Thanks for any advice and your time. -- Reggie |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick, Thanks for the reply. Works like a charm. Exactly what I was
looking for. At first it didn't work because the cell that held the deleteme string was a merged cell. Once I unmerged good to go. Thanks again for your time. "Rick Rothstein" wrote in message ... Give this macro a try... Sub ProcessDeleteMe() Dim DM As Range With Worksheets("Sheet1") On Error GoTo Done Set DM = .Columns("A").Find(What:="DeleteMe", MatchCase:=False) Application.Intersect(.UsedRange, Range(DM, .Cells( _ .Rows.Count, "A"))).EntireRow.Delete End With Done: End Sub -- Rick (MVP - Excel) "JRSmith" wrote in message ... Hi and TIA. What I'm trying to accomplish is to run code that checks column A starting at A1. Run down until it finds the word "DeleteMe" and from that row until the end of the document delete all rows. Is that possible? Thanks for any advice and your time. -- Reggie -- Reggie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find and delete rows macro | Excel Discussion (Misc queries) | |||
Find row and delete following rows | Excel Programming | |||
Find and delete all other rows | Excel Discussion (Misc queries) | |||
Find & Delete Rows | Excel Programming | |||
find and delete rows | Excel Programming |