+ Reply to Thread
Results 1 to 3 of 3

Detecting if only one row is selected, have problem with the Cntrl key

  1. #1
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Detecting if only one row is selected, have problem with the Cntrl key

    Hello,
    I want to enable button on the Menu and Toolbar if User is selected entire row (only one row). If it is selected some Range or more than one Row, the button must be disabled. I'm using this to detect what is the user selection:

    Please Login or Register  to view this content.

    I thought that everything is OK, I found that if the user selects entire row, and after that selects one more by holding Cntrl key pressed and selecting row, then I get wrong result, that only one row is selected. In fact I have two rows selected.

    Any ideas how I can solve this issue? I know there was similar post recently, but I can not find it. Thanks.

    Buran
    Last edited by buran; 07-07-2009 at 04:14 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Detecting if only one row is selected, have problem with the Cntrl key

    Hello Buran,

    To discover if there are disparate cells selected, you need to check the Areas property of the Range.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Detecting if only one row is selected, have problem with the Cntrl key

    Thanks a lot,

    I will check if this will solve my problem. I was surprised that this multiple selection dos not trigger Worksheet_SelectionChange event.

+ 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