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

Right click sheet tabview codecopy/paste this
Now when you double click either a5 or a6 1 will be added
Enter zero to start over

Private Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel As
Boolean)
If target.Address = "$A$5" Or target.Address = "$A$6" Then
On Error GoTo fixit
Application.EnableEvents = False
If target.Value = 0 Then oldvalue = 0
target.Value = 1 * target.Value + 1
oldvalue = target.Value
fixit:
Application.EnableEvents = True
End If
Cancel = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"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