+ Reply to Thread
Results 1 to 6 of 6

On Click Event

  1. #1
    Craig
    Guest

    On Click Event

    Is there an event in Excel VBA where I can trigger an event when the user
    selects a cell? Sort of like an oncurrent event in Access, where an event is
    fired when the user clicks on a cell. As the user selects cells, I want an
    event to fire based on the activecell's value or contents.

    I know there is a Worksheet_Activate event - I'm looking for a Cell_Activate
    event.

    Thanks.
    --
    Craig

  2. #2
    Mark
    Guest

    Re: On Click Event

    Private Sub Worksheet_Change(ByVal Target As Range)
    MsgBox "Something just changed, time to act!"
    End Sub

    or

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    MsgBox "A new cell has been selected, maybe act here?"
    End Sub

    One of the two is bound to be what you are after...


  3. #3
    William Horton
    Guest

    RE: On Click Event

    The Worksheet_SelectionChange(ByVal Target As Range) event may work for you.

    "Craig" wrote:

    > Is there an event in Excel VBA where I can trigger an event when the user
    > selects a cell? Sort of like an oncurrent event in Access, where an event is
    > fired when the user clicks on a cell. As the user selects cells, I want an
    > event to fire based on the activecell's value or contents.
    >
    > I know there is a Worksheet_Activate event - I'm looking for a Cell_Activate
    > event.
    >
    > Thanks.
    > --
    > Craig


  4. #4
    Craig
    Guest

    RE: On Click Event

    Thank you...
    --
    Craig


    "William Horton" wrote:

    > The Worksheet_SelectionChange(ByVal Target As Range) event may work for you.
    >
    > "Craig" wrote:
    >
    > > Is there an event in Excel VBA where I can trigger an event when the user
    > > selects a cell? Sort of like an oncurrent event in Access, where an event is
    > > fired when the user clicks on a cell. As the user selects cells, I want an
    > > event to fire based on the activecell's value or contents.
    > >
    > > I know there is a Worksheet_Activate event - I'm looking for a Cell_Activate
    > > event.
    > >
    > > Thanks.
    > > --
    > > Craig


  5. #5
    Registered User
    Join Date
    02-07-2012
    Location
    98052
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: On Click Event

    Interesting,

    perhaps a way to do toggle values/formulas etc.

    Once a cell has focus, just need a way to determine cell address, then I can act on it.

    changing Target As Range to target as Excel.Range and using target.address allow me to determine the selected cell (excel 2010)
    Last edited by toddbailey; 02-07-2012 at 07:53 PM.

  6. #6
    Registered User
    Join Date
    02-07-2012
    Location
    98052
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: On Click Event

    Is there a single and double click event we can use as well?

+ 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