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
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
"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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks