View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default run macro upon clicking a cell?

On selecting a cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "A1:H10"

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
'do your stuff
End With
End If

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"thebluerider"
wrote in message
news:thebluerider.2csi5g_1155995408.9223@excelforu m-nospam.com...

I wrote a little macro (module, general) and at the moment it's running
on pressing ctr+q.

Now I wonder if it's possible to make it run everytime i click a cell.

Or if not so, then if it's possible to make it run like every 2
seconds.

Please note that this is my first excel macro, so i don't really know
anything about macroes yet,

thx in advance,

the blue rider


--
thebluerider
------------------------------------------------------------------------
thebluerider's Profile:

http://www.excelforum.com/member.php...o&userid=37754
View this thread: http://www.excelforum.com/showthread...hreadid=573391