+ Reply to Thread
Results 1 to 2 of 2

Detecting Row Selection

  1. #1
    Nigel
    Guest

    Detecting Row Selection

    Hi All
    Is there a 'simple' way of detecting if a user selects an entire row in a
    worksheet that can be used to trigger an event?

    I have a need to control users who wish to delete an entire row by way of
    the CTRL- sequence.

    On another related matter, if a worksheet is protected (all cells) and an
    autofilter is in place, is there a way to detect that the user is clicking
    the autofilter ?

    TIA
    --
    Cheers
    Nigel





  2. #2
    Dave Peterson
    Guest

    Re: Detecting Row Selection

    You can use a worksheet_selectionchange event.

    Option Explicit
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = Target.EntireRow.Address Then
    MsgBox "whole row(s) selected"
    End If
    End Sub

    Rightclick on the worksheet tab that should have this behavior and select view
    code. Paste this into the code window.

    But I'm not sure if that will help.

    Maybe you could train them to do a shift-spacebar (to select the entirerow),
    then ctrl-hypen.

    =======
    For #2. Maybe you could tie into the worksheet_calculate event to see what the
    filters are.



    Nigel wrote:
    >
    > Hi All
    > Is there a 'simple' way of detecting if a user selects an entire row in a
    > worksheet that can be used to trigger an event?
    >
    > I have a need to control users who wish to delete an entire row by way of
    > the CTRL- sequence.
    >
    > On another related matter, if a worksheet is protected (all cells) and an
    > autofilter is in place, is there a way to detect that the user is clicking
    > the autofilter ?
    >
    > TIA
    > --
    > Cheers
    > Nigel


    --

    Dave Peterson

+ 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