Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Used Range of worksheet?

I have a problem when I am trying to clear all of the data off of a
worksheet except the Header rows. For example I may to clear any row after
#7 of all data, I've been using the range A7 to Z55500 EntireRow.Delete

BUT

Once I've copied the new records to that worksheet and want to loop through
them the count Range is really really high 55500+ and includes thousand of
blank rows. How can I clear a work sheet without messing up the used range?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Used Range of worksheet?

Rows(8).Resize(65536-7).Entirerow.Delete

--
Regards,
Tom Ogilvy


"HotRod" wrote in message
...
I have a problem when I am trying to clear all of the data off of a
worksheet except the Header rows. For example I may to clear any row after
#7 of all data, I've been using the range A7 to Z55500 EntireRow.Delete

BUT

Once I've copied the new records to that worksheet and want to loop

through
them the count Range is really really high 55500+ and includes thousand of
blank rows. How can I clear a work sheet without messing up the used

range?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Used Range of worksheet?

Tom I'll give it a try THANKS


"Tom Ogilvy" wrote in message
...
Rows(8).Resize(65536-7).Entirerow.Delete

--
Regards,
Tom Ogilvy


"HotRod" wrote in message
...
I have a problem when I am trying to clear all of the data off of a
worksheet except the Header rows. For example I may to clear any row
after
#7 of all data, I've been using the range A7 to Z55500 EntireRow.Delete

BUT

Once I've copied the new records to that worksheet and want to loop

through
them the count Range is really really high 55500+ and includes thousand
of
blank rows. How can I clear a work sheet without messing up the used

range?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Used Range of worksheet?

Tom
I've used the code that you have suggested but when I check the
UsedRange of the worksheet I still get 65536 as the used rows. Hence when I
try to loop through my code it tries to test all 65536 Rows. IDEAS? Here is
the code below. I've also posted this as a new topic.


First_Row = 3
Application.Worksheets("Work Sheet").Rows(First_Row).Resize(65536 -
First_Row).EntireRow.Delete

Debug.Print Application.Worksheets("Work Sheet").Rows.Count


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Used Range of worksheet?

I answered your later posting of this question.

--
Regards,
Tom Ogilvy


"HotRod" wrote in message
...
Tom
I've used the code that you have suggested but when I check the
UsedRange of the worksheet I still get 65536 as the used rows. Hence when

I
try to loop through my code it tries to test all 65536 Rows. IDEAS? Here

is
the code below. I've also posted this as a new topic.


First_Row = 3
Application.Worksheets("Work Sheet").Rows(First_Row).Resize(65536 -
First_Row).EntireRow.Delete

Debug.Print Application.Worksheets("Work Sheet").Rows.Count






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
Can you get the range reference for each page in a worksheet print range? Crosby Excel Programming 3 April 12th 05 06:06 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_2_] Excel Programming 2 September 22nd 04 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_3_] Excel Programming 0 September 22nd 04 03:26 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM


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

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"