Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to find specific data in a cell, then delete that row on down
I have a report that generates into Excel and it leaves some crap in
the last few rows that no one needs. It results in a few extra pages printing out (unless someone takes the time to manually remove those rows). I have a macro which does a lot of formatting to this particular report, to dress it up before printing. I'd like to be able to add a macro which would search for some specific data located in a cell near the bottom, then delete THAT row and the next 20 or so rows. The data to look for is: ASC database on SQL Server It's located in column B, but depending on the report, the row varies... Any help would be greatly appreciated! :) Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to find specific data in a cell, then delete that row on down
Sub DeleteRows()
Dim c As Range Set c = Cells.Find(What:="ASC database on SQL Server", _ After:=Range("B1"), LookIn:=xlFormulas, LookAt:=xlPart, _ SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) Rows(c.Row & ":" & c.Row + 20).Delete End Sub Hth, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i find specific data in a cell and its colocated cell data | Excel Worksheet Functions | |||
Macro to delete rows containing specific data | New Users to Excel | |||
Macro to delete specific rows above selected cell | Excel Programming | |||
How do i create a macro to find a specific data? | Excel Programming | |||
macro to find date format in a cell and delete that entire row | Excel Programming |