Hi all,
I am relatively new to Excel VBA coding and i have created a cricket scoring workbook. Everything is working excellently and now i am adding a few things that will make the scorebook more interesting and informative.
My question is this: When a player reaches milestones, like 50 runs, 100 runs etc, i would like a msgbox to popup with the relavent info (ie - "50 Runs" or "100 Runs").
If i use the following code, the msgbox pops up all the time:
If Cells(6,3).value = 50 then
msgbox "50 Runs"
Elseif Cells(6,3).value = 51 then
msgbox "50 Runs"
etc etc.
The scoring works like this:
A player can score anything from 1 to 6 runs off one ball, so a player can pass the 50-run mark by moving from 49 to 50, or from 48 to 52 or 47 to 53 or from 49 to 55.
What i would like to do is for a msgbox to appear just once when the player passes the 50 mark or the 100 mark etc.
I have seen this appear in other scoring applications but cannot figure out what the coding is to make this happen.
Your help and assistance would be greatly appreciated.
I am relatively new to Excel VBA coding and i have created a cricket scoring workbook. Everything is working excellently and now i am adding a few things that will make the scorebook more interesting and informative.
My question is this: When a player reaches milestones, like 50 runs, 100 runs etc, i would like a msgbox to popup with the relavent info (ie - "50 Runs" or "100 Runs").
If i use the following code, the msgbox pops up all the time:
If Cells(6,3).value = 50 then
msgbox "50 Runs"
Elseif Cells(6,3).value = 51 then
msgbox "50 Runs"
etc etc.
The scoring works like this:
A player can score anything from 1 to 6 runs off one ball, so a player can pass the 50-run mark by moving from 49 to 50, or from 48 to 52 or 47 to 53 or from 49 to 55.
What i would like to do is for a msgbox to appear just once when the player passes the 50 mark or the 100 mark etc.
I have seen this appear in other scoring applications but cannot figure out what the coding is to make this happen.
Your help and assistance would be greatly appreciated.