Determining last active cell in a protected worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top