LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default delete all lines after finding criteria

Hi all, I seem to be asking lots of questions today- I think I must have run
over a black cat!

I tried to modify some code I found to delete all rows after finding the
words "end of report". I download a report to SAP and I am trying to tidy it
up.

I tested the code and it worked so I cut it into a much larger code that
does a whole lot of things, this being just one of. Here's the code I used:

'delete lines after the word "End of Report"

fr = Columns(1).Find("End Of Report").Row
lr = Cells(Rows.Count, "a").End(xlUp).Row
Rows(fr & ":" & lr).Delete

It comes up wtih a run time error 91- object required.

I am only self taught - or should I say user group taught. I just don't get
the whole object thing despite trying to read the manual. I know I have to
set the variable for fr and lr. lr =lastrow and I think I can just replace lr
with Lastrow, however, what do I do for the first row of the range (i.e. fr)?

Any help would be appreciated. I feel quite dumb not getting it. :(

Cheers
Gai
 
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
Keep lines when one column equals certain criteria Donna[_2_] Excel Worksheet Functions 2 April 23rd 10 01:16 AM
FInding Min Value with Criteria AndrewK Excel Worksheet Functions 11 August 11th 09 07:56 AM
Finding the value for the point two lines cross Brian Charts and Charting in Excel 1 March 2nd 06 11:59 PM
Counting lines that meet TWO criteria sam Excel Worksheet Functions 2 January 31st 06 09:04 PM
Sum for lines equal to criteria rfhorn Excel Worksheet Functions 5 April 28th 05 01:55 PM


All times are GMT +1. The time now is 11:15 PM.

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

About Us

"It's about Microsoft Excel"