Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default hot to get a tally of the number of times a cell is clicked

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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


  #3   Report Post  
Posted to microsoft.public.excel.misc
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



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default hot to get a tally of the number of times a cell is clicked

..........
With Target
.Offset(0, 1).Value = .Offset(0, 1).Value + 1
.Offset(0, 1).Select
End With
..........


Just a comment to help save some typing...

With Target.Offset(0, 1)
.Value = .Value + 1
.Select
End With

Rick
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula to keep a running tally of the number of times a certain w CJZ Excel Discussion (Misc queries) 4 November 8th 06 01:04 AM
How do I count the number of times a letter is used in a cell? jsrawlings Excel Discussion (Misc queries) 5 June 28th 06 02:02 AM
create tally sheet for positions- insert names and tally # tally sheets Excel Discussion (Misc queries) 0 April 11th 06 09:41 PM
Tool bar Icons should get brighter when clicked several times ictusa Excel Discussion (Misc queries) 1 December 18th 05 04:26 PM
Count number of times a specific number is displayed in a cell ran subs Excel Worksheet Functions 1 June 27th 05 05:01 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"