Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scorecard
I was wondering if someone could help me here. I want to use EXCEL to create a scorecard with up to 5 players. The values to be entered are set on command buttons when I click on them. The values (50,100,250...) will be the total of a roll of dice in a game. Each button will have a value on them and when clicked, add that value to the score box for that player.
1. My problem is: how do I set the value of the button. 2. Get the button value to the player's score box. 3. be able to click the command button more than once to add the score (hit the "100" button 2 times to get "200") I plan to use this for my Ipaq when we play on the road. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scorecard
I used a combobox to pick the players and command buttons to enter the score. Cells A1:C1 contained Player #s (1,2,3). B1:b3 was player names. C1:C3 was score. For the combobox, the following properties we assigned as follows:
BoundColumn = 1 ColumnCount = 2 ColumnWidths = 0 ListFillRange = Sheet1!A1:B3 and the code for the controls: Dim Player As Integer Private Sub ComboBox1_Change() Player = ComboBox1.Value End Sub Sub Add_50() With Cells(Player, 3) .Value = .Value + 50 End With End Sub Add_100 and others would look exactly the same, just change the .Value + 50 part. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scorecard
Make sure you select the player first, so as to assign a number to the Player variable. Also, you can abstract the points buttons somewhat with this:
Sub AddNum() Dim NumToAdd As Integer Select Case Application.Caller Case "Button 1": NumToAdd = 50 Case "Button 2": NumToAdd = 100 End Select With Cells(Player, 3) .Value = .Value + NumToAdd End With End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scorecard
Thank you and what you wrote tell me that I have so much to learn. I can see where I need to place the code you wrote, and have made some progress. but..
Do the command buttons go in the Control box? How are the Player-Name-Score cells linked to the control box? My end goal is to transfer this spreadsheet to my ipaq PDA to keep a running score. PS. How long did it take you to learn all of this? I am way impressed as I am self taught. Thanks again, I will try working on figuring it out. Happy 4th of July "Marcotte A" wrote: Make sure you select the player first, so as to assign a number to the Player variable. Also, you can abstract the points buttons somewhat with this: Sub AddNum() Dim NumToAdd As Integer Select Case Application.Caller Case "Button 1": NumToAdd = 50 Case "Button 2": NumToAdd = 100 End Select With Cells(Player, 3) .Value = .Value + NumToAdd End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tennis Scorecard Help | Excel Worksheet Functions | |||
scorecard | New Users to Excel | |||
Supplier scorecard | Excel Discussion (Misc queries) | |||
golf scorecard | Excel Discussion (Misc queries) | |||
ScoreCard | Excel Programming |