#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Last cell

Hi Group,
I am using - ActiveCell.SpecialCells(xlLastCell).Select - to find the lst
cell. Then I am using - Rows((TopRow) & ":" & (BottomRow)).Delete - to delete
a range of rows. What I expected was that the "xlLastCell" would change, but
it did not.

I am essentailly trying to "raise" the location of the "LastCell" to a row
higher than it currectly occupies. In fact I thought this was the only way to
do it? I am using VB 6.3 in Office Professional in Excel 2003. Has something
changed?
--
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Last cell

Hi David,

This is standard Excel behaviour. To reset the LastCell you can either save
the workbook or execute the following:

ActiveSheet.UsedRange

Naturally, if controlling Excel from VB you would need to qualify the above
with a reference to the Excel Application. Something like:

xlApp.ActiveSheet.UsedRange

--
John Green
Sydney
Australia


"David" wrote in message
...
Hi Group,
I am using - ActiveCell.SpecialCells(xlLastCell).Select - to find the lst
cell. Then I am using - Rows((TopRow) & ":" & (BottomRow)).Delete - to

delete
a range of rows. What I expected was that the "xlLastCell" would change,

but
it did not.

I am essentailly trying to "raise" the location of the "LastCell" to a row
higher than it currectly occupies. In fact I thought this was the only way

to
do it? I am using VB 6.3 in Office Professional in Excel 2003. Has

something
changed?
--
David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Last cell

I am not trying to find the used range. I am trying to change the Last used
row from 100 to 80. In previous versions, I believe that I deleted rows 100
to 81 and that raised the last row used to 80. I did not have to save the
workbook and reopen it to do this either.
Thanks

"John Green" wrote:

Hi David,

This is standard Excel behaviour. To reset the LastCell you can either save
the workbook or execute the following:

ActiveSheet.UsedRange

Naturally, if controlling Excel from VB you would need to qualify the above
with a reference to the Excel Application. Something like:

xlApp.ActiveSheet.UsedRange

--
John Green
Sydney
Australia


"David" wrote in message
...
Hi Group,
I am using - ActiveCell.SpecialCells(xlLastCell).Select - to find the lst
cell. Then I am using - Rows((TopRow) & ":" & (BottomRow)).Delete - to

delete
a range of rows. What I expected was that the "xlLastCell" would change,

but
it did not.

I am essentailly trying to "raise" the location of the "LastCell" to a row
higher than it currectly occupies. In fact I thought this was the only way

to
do it? I am using VB 6.3 in Office Professional in Excel 2003. Has

something
changed?
--
David




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Last cell

Every version of Excel, since it first appeared on the Macintosh in the mid
80s, has exhibited the same behaviour. Deleting data or rows does not reset
the last used row (or the last used column or the used range). Prior to
Excel 97 (if my memory serves me), it was necessary to Save the worksheet or
workbook to reset the last used row/column. It is not necessary to close and
reopen the file. Just Save it.

In the latest versions of Excel the same effect can be achieved with
wks.UsedRange where wks is a reference to the worksheet object.


--
John Green
Sydney
Australia


"David" wrote in message
...
I am not trying to find the used range. I am trying to change the Last

used
row from 100 to 80. In previous versions, I believe that I deleted rows

100
to 81 and that raised the last row used to 80. I did not have to save the
workbook and reopen it to do this either.
Thanks

"John Green" wrote:

Hi David,

This is standard Excel behaviour. To reset the LastCell you can either

save
the workbook or execute the following:

ActiveSheet.UsedRange

Naturally, if controlling Excel from VB you would need to qualify the

above
with a reference to the Excel Application. Something like:

xlApp.ActiveSheet.UsedRange

--
John Green
Sydney
Australia


"David" wrote in message
...
Hi Group,
I am using - ActiveCell.SpecialCells(xlLastCell).Select - to find the

lst
cell. Then I am using - Rows((TopRow) & ":" & (BottomRow)).Delete - to

delete
a range of rows. What I expected was that the "xlLastCell" would

change,
but
it did not.

I am essentailly trying to "raise" the location of the "LastCell" to a

row
higher than it currectly occupies. In fact I thought this was the only

way
to
do it? I am using VB 6.3 in Office Professional in Excel 2003. Has

something
changed?
--
David






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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Excel Discussion (Misc queries) 0 June 26th 09 06:01 PM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


All times are GMT +1. The time now is 01:16 PM.

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"