Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Determining last active cell in a protected worksheet

I need to ascertain the last used cell (actually the last used row and the
last used column) in a protected worksheet.

I have tried specialcells(xlLastCell) but this fails when the sheet is
protected.

Any help appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default Determining last active cell in a protected worksheet

Have you tried ctrl-end? Unless you're doing it through VBA. Then you can
always try
myLastRow = _
.Cells.Find("*", After:=.Cells(1), _
LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
myLastCol = _
.Cells.Find("*", After:=.Cells(1), _
LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column

cheers,

Scott
"Paul" wrote:

I need to ascertain the last used cell (actually the last used row and the
last used column) in a protected worksheet.

I have tried specialcells(xlLastCell) but this fails when the sheet is
protected.

Any help appreciated

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Determining last active cell in a protected worksheet

Scott

Many thanks - the only thing I had to change was .cells. to just cells.

And yes, I am trying to do this with VBA.

Paul

"Scott" wrote:

Have you tried ctrl-end? Unless you're doing it through VBA. Then you can
always try
myLastRow = _
.Cells.Find("*", After:=.Cells(1), _
LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
myLastCol = _
.Cells.Find("*", After:=.Cells(1), _
LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column

cheers,

Scott
"Paul" wrote:

I need to ascertain the last used cell (actually the last used row and the
last used column) in a protected worksheet.

I have tried specialcells(xlLastCell) but this fails when the sheet is
protected.

Any help appreciated

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 can I have formatting toolbar active for the unprotected(unlocked) cells of the protected worksheet??? sanam Excel Discussion (Misc queries) 6 July 20th 06 01:42 PM
Is the active worksheet protected? mthomas[_13_] Excel Programming 2 August 16th 05 11:03 PM
Determining active conditional format of one cell Antonio[_3_] Excel Programming 1 November 27th 03 12:38 AM
Determining Active Row Number Don Guillett[_4_] Excel Programming 0 August 20th 03 11:04 PM
Determining Active Row Number Scott Patrias Excel Programming 0 August 20th 03 09:14 PM


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