Re: End of column in Excel
Re: End of column in Excel
- Subject: Re: End of column in Excel
- From: Kai Edwards <email@hidden>
- Date: Wed, 30 Jan 2002 19:38:19 +0100
>
Date: Tue, 29 Jan 2002 00:23:09 -0600
>
Subject: Re: End of column in Excel
>
From: Jay Young <email@hidden>
>
To: email@hidden
>
>
Thank you Deivy, Kai & David,
>
>
I appreciate your help with this. I've been working with the code you
>
all sent as well as looking somemore at the Excel Dictionary and I came
>
up with this and it seems to work pretty good.
Delighted you found the solution you were after. The script looks pretty
good, too!
>
The only problem is that
>
if any rows are deleted before the script runs it will still grab the
>
empty rows up to where the last item used to be. But I think that
>
should be okay.
This cell 'latency' can still be a bit irritating though, can't it?
I have a sneaking suspicion that the problem may lie in the way Excel keeps
track of the 'LastCell' co-ordinates. When you enter data in a cell beyond
the previous last row/column, Excel can just update the 'LastCell' property
to the new position. However, when you clear or delete cells, the bounds of
the remaining 'live' cells are unknown - until the entire worksheet is
updated.
Although this should happen automatically (IMHO), it apparently doesn't
(even when other recalculations are performed). For many purposes, this
slight 'lapse' may be inconsequential - although it has rattled your script
somewhat.
Here's the fix:
After you've deleted or cleared any cells, simply save your work in Excel.
This should force an update - and result in the correct reference being
returned for 'LastCell'.
HTH
Kai
PS:
Apologies for delayed response. Server problems put me back 24 hours. :(
--
**********************************
Kai Edwards Creative Resources
1 Compton Avenue Brighton UK
Telephone +44 (0)1273 326810
**********************************