Thread: Last used cell
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 153
Default Last used cell

I guess I am not communicating well. Is there a way to
change to last used cell? The cell you get to when you do
Ctrl + End. I don't want to hide anything, but actually
change the last used cell.

-----Original Message-----

"David" wrote in

message
...

Sorry if I was not clear. Will try again. CTRL+End

takes
you to the highest used row and column(down the sheet).
The cell does not have to have anything in it, but it

did
at one time, during the life of the use of that sheet.
Deleting rows in that worksheet does not change that
Row/Column, if you do CTRL+End you are back to the same
cell. You use to be able to delete that row using code
and the last cell used would change. If you did CTRL +
End, you did not get back to the same row/column, but a
lower row, depending on how many rows you deleted with
the code. In version 2003, I longer seem to be able to

do
that and the question is, what has changed or am I
missing something, such as a perameter? Hope this is
clearer. What I am really attempting to do is find the
last cell used and change that last cell, by deleting
rows.


Try this:

It will unhide all the rows and columns in each sheet

(and each sheet)
so you might want to alter that or go back afterward and

re-hide as
you
prefer.

Alan.


+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


Sub ResetUsedRange()


For Each Sht In ActiveWorkbook.Worksheets

Sht.Activate

Sht.Visible = True

Cells.Select


Selection.EntireColumn.Hidden = False

Selection.EntireRow.Hidden = False


Sht.UsedRange

Next


End Sub





+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-



.