Thread: Last cell
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Last cell


since xl97(SR-1?).. the last cell is reset on save.

the last cell (as microsoft sees it) is the last cell which contains
data, comments or FORMATS(fill/numberformat or else).

you can force a recompute of lastcell:
in code: by calling the usedrange method.
but you may have to clear formats outside "your" usedrange first.

Dim lng&
lng = wks.UsedRange.Count

Manually by DELETING all Rows and Columns beyond
what you want the usedrange to be.

HOWEVER: if row 65536 or column 256 or any cell therein
contains any formatting.. you FIRST have to reset the
formats else the newly inserted rows will get that format and your
usedrange wont change.




keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"David" wrote:

Hi Group,
This is a second post for this question and I am having a
hard time explaining it, but here it goes again.

Ctrl+End takes you to the last used cell in a worksheet.
I am using version 2003. In previous versions, I could
change the last used cell by deleting rows, but only by
doing this with code. I don't seem to be able to do that
anymore with this version. Has something changed or maybe
I am missing a parameter?

Thanks