Help with Darts spreadsheet

DNaz

New Member
Joined
Feb 11, 2011
Messages
11
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello all, new to VBA/Marcos and need help with a function of a darts spreadsheet I'm developing. Did a google search and a few posts/threads from here came up so I figured I'd ask you guys for help.

I'm trying to create a sheet for a game of Cricket. For those of you that don't know how to play that game, you have to "close" the numbers 20 down to 15 as well as the bullseye by hitting each section three times. Throwing a dart into the Doubles area counts as 2 and the Triples area counts as 3, obviously. There is also a variation whereby if one player has closed a number and their opponent hasn't, then they can score points by hitting the closed number (I.E., if player one has closed the 20's and player 2 hasn't, each time player 1 throws a dart into the 20 area they get 20 added to their total score).

I downloaded a spreadsheet from another site that uses a dropdown list to select the number of hits and the score has to be entered manually, but I want to create a macro that does all this automatically. For example: I have six cells in one row like B4, B5, B6, B7, B8 and B9. B4/B7 have buttons in them, B5/B8 are blank, and B6/B9 have 0. I want to push the button in B4/B7 and have a 1 show in B5/B8. If the button is pressed again, a 2 shows in B5/B8 and if pressed a third time, a 3 shows. Then if pressed a fourth time, it stops the increment and checks the other cell to see if a 3 is there and if not then 20 is added to B6/B9 and if yes then nothing.

Now, I have adapted a code to do this but I don't know how to stop the increment nor to check the other cell. It is shown below. Any help someone here could provide would be greatly appreciated. I just hope what I'm asking isn't clear as mud.

Code:
Sub Button20_1()
Range("B5") = Range("B5") + 1
If Range("B5") = 4 = True Then
Range("B6") = Range("B6") + 20
End If
End Sub
 
Dude, you are a godsend. That code works perfect. My spreadsheet works exactly how I want it now. I wish I had a way on here to give you some reputation. Cheers.


Is there a copy of this available? I would love to check it out. Have been looking for one for quite some time.

Chris
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,225,889
Messages
6,187,677
Members
453,435
Latest member
U4US

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top