+ Reply to Thread
Results 1 to 3 of 3

Determining last active cell in a protected worksheet

Hybrid View

  1. #1
    Paul
    Guest

    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. #2
    Scott
    Guest

    RE: 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. #3
    Paul
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1