creating a stats page

S

sweepy

Hi me and some freind have a pool tabel we wery often so we want to kee
track of the scoors but is there a way to put in a button in exce
(value on click +1) i mean like i you press the button the number i
fromt of it get's mulitplyed (12 after click 13) cos the set up i
gonna be like

Name | Win | Loss | Fauls |
-----------------------------------------------
test 1 | (---) | (---) | (---) |


sum thinglike that (---) equals a button btw


Please help u
 
D

Dave Peterson

How about using the right click to increment the value (I'm confused about the
multiplying):


Rightclick on the worksheet tab that should have this behavior and select view
code.

Paste this into the code window:

Option Explicit
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)

If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("B2:D999")) Is Nothing Then Exit Sub

Cancel = True

With Target
If IsNumeric(.Value) Then
.Value = .Value + 1
Else
Beep
End If
End With
End Sub

If you rightclick any place in B2:d999, it'll add one to that cell.

(You could use Worksheet_BeforeDoubleClick, too. But there isn't a single click
event.)

If you make a mistake and rightclick too many times, you can just type the old
value you had before--if you remember it!
 
Top