Excel counter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 
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?
 
Many thanks Bob
I will now try to adapt your code to my monitoring stats and hope it works! ie hope I enter correctly as yours certainly works . You've been a great help
Regards Teres
----- Bob Phillips wrote: ----

Hoi Teresa

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

Private Sub Worksheet_SelectionChange(ByVal Target As Range
Application.EnableEvents = Fals
On Error GoTo sub_exi
If Not Intersect(Target, Range("tickf")) Is Nothing The
Range("countf").Value = Range("countf").Value +
Range("countf").Selec
ElseIf Not Intersect(Target, Range("tickm")) Is Nothing The
Range("countm").Value = Range("countm").Value +
Range("countm").Selec
End I
sub_exit
Application.EnableEvents = Tru
End Su


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

--

HT

Bob Phillip
... looking out across Poole Harbour to the Purbeck
(remove nothere from the email address if mailing direct

Teresa said:
adding information (for example count male and female) I wish to click in
tick box and then add one to the total (running total). does anyone know ho
to do this in Excel. Could this be a macro
 
Hi Peo
Many thanks for your reply, I have loked at the site and printed it out for a closer look
regards Teres
----- Peo Sjoblom wrote: ----

For a possible solution see

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



--

Regards

Peo Sjoblo


Teresa said:
adding information (for example count male and female) I wish to click in
tick box and then add one to the total (running total). does anyone know ho
to do this in Excel. Could this be a macro
 
Back
Top