Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you get the range reference for each page in a worksheet print range? | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
copy range on every worksheet (diff names) to a master worksheet (to be created) | Excel Programming | |||
copy range on every worksheet (diff names) to a master worksheet (to be created) | Excel Programming | |||
How? Macro to copy range to new worksheet, name new worksheet, loop | Excel Programming |