#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Used Range

I have date in the first 50 rows of a worksheet.

If I delete rows 10 through 100 by using either:

rows("10:100").select
selection.delete

or

rows("10:100").select
selection.clear

then I should only have data in the first 9 rows.

I have a function that is relying on the used range. I
would expect the following to return an address that ends
in row 9. However it returns an address that ends in row
100.

UsedRange.SpecialCells(xlCellTypeLastCell).Address

Any ideas why row 100 is still in the used range??? TIA...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Used Range

The UsedRange doesn't get updated when data is deleted.

Take a look a t Debra Dalgleish's FAQ on this at
http://www.contextures.com/xlfaqApp.html#Unused

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Hawk" wrote in message
...
I have date in the first 50 rows of a worksheet.

If I delete rows 10 through 100 by using either:

rows("10:100").select
selection.delete

or

rows("10:100").select
selection.clear

then I should only have data in the first 9 rows.

I have a function that is relying on the used range. I
would expect the following to return an address that ends
in row 9. However it returns an address that ends in row
100.

UsedRange.SpecialCells(xlCellTypeLastCell).Address

Any ideas why row 100 is still in the used range??? TIA...



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 do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Cond. Format Data Bars of range based on values of another range alexmo Excel Worksheet Functions 4 January 16th 09 04:03 AM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 01: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"