+ Reply to Thread
Results 1 to 3 of 3

Select Method Failing

  1. #1
    Registered User
    Join Date
    02-11-2004
    Posts
    15

    Question Select Method Failing

    Does anyone know a common cause of/solution to the Select Method of a Range Object failing. I'm running this code during the deactivate subfunction:

    cRow = Range("$A:$A").Cells(Rows.Count, 1).End(xlUp).Row
    Range(Cells(2, 1), Cells(cRow, 2)).Select

    This code worked last week, but this week it has decided to break.

    Cheers-
    Chris Krahe

  2. #2
    JE McGimpsey
    Guest

    Re: Select Method Failing

    When you set a breakpoint and step through the code, what does cRow
    evaluate to?

    In article <[email protected]>,
    cmk18 <[email protected]> wrote:

    > Does anyone know a common cause of/solution to the Select Method of a
    > Range Object failing. I'm running this code during the deactivate
    > subfunction:
    >
    > cRow = Range("$A:$A").Cells(Rows.Count, 1).End(xlUp).Row
    > Range(Cells(2, 1), Cells(cRow, 2)).Select
    >
    > This code worked last week, but this week it has decided to break.


  3. #3
    Tom Ogilvy
    Guest

    Re: Select Method Failing

    The deactivate event fires after the sheet with the code has lost the focus.
    Thus you get the error because you can not select on that sheet.

    As written, you must be mistaken. It has probably never worked in the
    deactivate event.

    It is unclear where you are trying to select so not sure what to recommend.

    --
    Regards,
    Tom Ogilvy

    "cmk18" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Does anyone know a common cause of/solution to the Select Method of a
    > Range Object failing. I'm running this code during the deactivate
    > subfunction:
    >
    > cRow = Range("$A:$A").Cells(Rows.Count, 1).End(xlUp).Row
    > Range(Cells(2, 1), Cells(cRow, 2)).Select
    >
    > This code worked last week, but this week it has decided to break.
    >
    > Cheers-
    > Chris Krahe
    >
    >
    > --
    > cmk18
    > ------------------------------------------------------------------------
    > cmk18's Profile:

    http://www.excelforum.com/member.php...fo&userid=6047
    > View this thread: http://www.excelforum.com/showthread...hreadid=386242
    >




+ 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