View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default hot to get a tally of the number of times a cell is clicked

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0, 1).Value = .Offset(0, 1).Value + 1
.Offset(0, 1).Select
End With
End If

ws_exit:
Application.EnableEvents = True
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

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Steve Jones" <Steve wrote in message
...
I want to click a cell as a tally record to show how many times I have
clicked each cell. This will be used in an analysis spreadsheet of no. of
people enquiring about various products at our trade show. So I want to
display a number tally to be shown in each cell.
Currently I am writing the new number each time I enter in the cell -
would
be much easier to just click the cell & let it increase the number count
by 1
each click.
Thanks