+ Reply to Thread
Results 1 to 2 of 2

Activating macro on mouseclick

  1. #1
    Hmmm
    Guest

    Activating macro on mouseclick

    I have been trying to set up a macro which will run when I click on a
    cell, to change the value in another cell.

    I have tried a number of variations around the following around Private
    Sub Worksheet_SelectionChange(ByVal target As Range), but I'm getting
    an error saying "Ambiguous name detected: Worksheet_SelectionChange".

    All I want to do is run macro that checks the value of the clicked cell
    and update another cell if appropriate.


  2. #2
    K Dales
    Guest

    RE: Activating macro on mouseclick

    Where did you put the macro? The message you are getting is because it can't
    find the "right" version of the macro to run. Your code needs to be in the
    module for the worksheet; i.e. in the VBA editor show the Project Explorer
    and double-click on the line for the worksheet you are using. If you have
    used the macro name Worksheet_SelectionChange in another module you added,
    that might be why it is getting an "Ambiguous Name" since when you call the
    macro it can't tell which one to run - the one for the sheet or the one in
    the module.
    --
    - K Dales


    "Hmmm" wrote:

    > I have been trying to set up a macro which will run when I click on a
    > cell, to change the value in another cell.
    >
    > I have tried a number of variations around the following around Private
    > Sub Worksheet_SelectionChange(ByVal target As Range), but I'm getting
    > an error saying "Ambiguous name detected: Worksheet_SelectionChange".
    >
    > All I want to do is run macro that checks the value of the clicked cell
    > and update another cell if appropriate.
    >
    >


+ 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