How can I capture the event in Excel when a user clicks on a cell. I want to be able to use this event to trigger some code to count how many times the user clicks on several different cells in a column.
+2
A:
Check out the Worksheet_SelectionChange event. In that event you could use Intersect() with named ranges to figure out if a specific range were clicked.
Here's some code that might help you get started.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("SomeNamedRange")) Is Nothing Then
'Your counting code
End If
End Sub
Robert S.
2008-09-29 15:17:08
A:
Worksheet SelectionChange event would do it. Note that this fires every time user clicks a new cell.
Andrew Cowenhoven
2008-09-29 15:18:06