Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all rows below The word Page: 2 of 25
Need to delete all rows below the word Page: 2 of 25
Do to the report it could be at any row however it usually is in cell Need to clean up the junk in a macro I sort by part but thiers trash below. Even tried to filter but it won't filter out Thanks DJ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all rows below The word Page: 2 of 25
Do you mean that in some cell you have "Page: 2 of 25"? And it usually is
in Column V? But not always? One way: Sub DeleteRows() Dim FoundCell As Range Set FoundCell = ActiveSheet.UsedRange. _ Find(What:="Page: 2 of 25", LookAt:=xlWhole) On Error GoTo NotFound Range("A" & FoundCell.Row + 1, Range("A" & Rows.Count)). _ EntireRow.Delete On Error GoTo 0 Exit Sub NotFound: On Error GoTo 0 MsgBox "Text not found." End Sub "Duncan J" wrote in message ... Need to delete all rows below the word Page: 2 of 25. Do to the report it could be at any row however it usually is in cell V Need to clean up the junk in a macro I sort by part but thiers trash below. Even tried to filter but it won't filter out. Thanks, DJ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all rows below The word Page: 2 of 25
That works great. I needed to delete the text Page: 2 of 25. I did a find replace on that and stuck it in the macro
I sorted my part number so all above the text Page: 2 of 25 is great and the junk below needs to be deleted. This worked for me Thanks DJ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all rows below The word Page: 2 of 25
Duncan
The FoundCell is the cell than contains the text you searched for. You don't need to Find/Replace it to clear it. If you want to delete that text, just say: FoundCell.ClearContents Glad it worked for you. Otto "Duncan J" wrote in message ... That works great. I needed to delete the text Page: 2 of 25. I did a find replace on that and stuck it in the macro. I sorted my part number so all above the text Page: 2 of 25 is great and the junk below needs to be deleted. This worked for me! Thanks, DJ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to delete the word I typed on the excel page? | Excel Discussion (Misc queries) | |||
Excel Table into Word with header rows on top of each page | Excel Discussion (Misc queries) | |||
PROBLEM:How to squeeze 2 Page sized Chart in Excel 2000 & embed in Word 2000 and print from Word to fit one page ??? | Excel Discussion (Misc queries) | |||
PROBLEM:How to squeeze 2 Page sized Chart in Excel 2000 & embed in Word 2000 and print from Word to fit one page ??? | New Users to Excel | |||
Delete all rows with designated word | Excel Programming |