Excel counter

T

Teresa

Hi All

I have a lot of information which I wish to turn into a tally chart. When adding information (for example count male and female) I wish to click in a tick box and then add one to the total (running total). does anyone know how to do this in Excel. Could this be a macro?

Any help would be appreciated as Im a beginner in excel. Thanks

Teresa
 
P

Peo Sjoblom

For a possible solution see:

http://www.mcgimpsey.com/excel/accumulator.html



--

Regards,

Peo Sjoblom


Teresa said:
Hi All!

I have a lot of information which I wish to turn into a tally chart. When
adding information (for example count male and female) I wish to click in a
tick box and then add one to the total (running total). does anyone know how
to do this in Excel. Could this be a macro?
 
B

Bob Phillips

Hoi Teresa,

Here is some simple code that does it. It assumes that the tick box cells
are named cell called 'tickf' and 'tickm' (no quotes), and the counts are
called 'countf' and 'countm'.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("tickf")) Is Nothing Then
Range("countf").Value = Range("countf").Value + 1
Range("countf").Select
ElseIf Not Intersect(Target, Range("tickm")) Is Nothing Then
Range("countm").Value = Range("countm").Value + 1
Range("countm").Select
End If
sub_exit:
Application.EnableEvents = True
End Sub


It is worksheet code, so it goes in the worksheet code module (right-click
on the sheet name tab, select Viwe Code and paste the code in).

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Teresa said:
Hi All!

I have a lot of information which I wish to turn into a tally chart. When
adding information (for example count male and female) I wish to click in a
tick box and then add one to the total (running total). does anyone know how
to do this in Excel. Could this be a macro?
 
Top