Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete the word I typed on the excel page? Loan Duong Excel Discussion (Misc queries) 3 May 11th 10 05:05 PM
Excel Table into Word with header rows on top of each page AndrewL Excel Discussion (Misc queries) 0 October 5th 09 09:10 PM
PROBLEM:How to squeeze 2 Page sized Chart in Excel 2000 & embed in Word 2000 and print from Word to fit one page ??? [email protected] Excel Discussion (Misc queries) 2 September 10th 08 11:07 AM
PROBLEM:How to squeeze 2 Page sized Chart in Excel 2000 & embed in Word 2000 and print from Word to fit one page ??? [email protected] New Users to Excel 2 September 10th 08 11:07 AM
Delete all rows with designated word PHILLY Excel Programming 9 December 4th 03 01:58 PM


All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"