View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default 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.