View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gilles P (FR)
 
Posts: n/a
Default run macro when cell is selected

Try this that works, but i don't know why, sorry...
..
One for Selection change, one by formula

Private Sub Worksheet_Change(ByVal Target As Range)
macro Target
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
macro Target
End Sub

Gilles P



"beauty_bobaloo" a écrit :

I have been trying to figure this out for hours now.

I just want to run a macro when a certain cell is selected.
upon investigation, i have found that I can right click on the sheet tab and
view the code. I can then add the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$a$1" Then
run(macro1)
end if
End Sub

I know that this doesn't work, but I can't figure out how to get it to work.
Any help will be greatly appreciated.

thanks in advance

Melissa