I Need A Counter

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
982
Office Version
  1. 2021
Platform
  1. Windows
Hello All,
I have two Active X buttons which runs my game: one runs the game, and the other ends the game. How can I install a counter (any cell I want) to count the number of times, every time I push the run game button, and then reset itself to zero when I push the end game button?
Excel 2010
Developer tab enabled
Thanks for the help
Charles
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I used cell A1, but it is pretty straightforward:

Code:
Private Sub CommandButton1_Click()
Range("A1") = Range("A1") + 1
End Sub
 
Private Sub CommandButton2_Click()
Range("A1") = 0
End Sub
 
Upvote 0
Thanks for the reply...
I understand the code, but I dont know how to tell which one is command button1 & which one is command button 2...becasue I also have two other buttons, 4 total buttons; where do I find that information out in the develooper tab?
Thanks
Charles
 
Upvote 0
Right click on the control and click on Properties, you can give the buttons more meaningful names here as well.
 
Upvote 0
Thanks for the response, apparently the creator of the game made the buttons into pictures...not sure how he did that. Anyway, if you wish to see this thing, (and wish to spend any time with it) Ive put it into dropbox (link below) all I need is a counter in one of the cells, so I know how many times I push the "Next Week" button. The "Play Again" button is the button that when pushed, the counter will reset to zero.
The game defaults to a password protected document, however, there is no password, unprotect sheet works fine.
thanks for your time
Charles Reichert
By the way, I don't plan on publishing this thing, or any type of plagiarism, it's just for personal use, so I don't believe adding a counter in one of the cells will harm anybody...

http://dl.dropbox.com/u/38041434/Game Time!.xlsm
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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