I am just picking up the MsgBox macro in VBA and have come to a snag.
I'm working on a file for our company trainer to jazz up their training class with an Excel game. Within the game, I am counting the number of times a 1 appears within a certain group of cells. Those 1's are hidden and correspond to another group of cells that the trainees can see on the projector. Once the number of 1's within the range adds up to 25, I have a popup window to let the team know they won. (Please see below).
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("BE16")) Is Nothing Then Exit Sub
If Target.Value = "25" Then Exit Sub
MsgBox "CONGRATULATIONS TEAM 1! You are the winners!! "
End Sub
Team 1's points add up in cell BE16 and Team 2's points are tallied in cell BF16. It seems straightforward but I cannot seem to formulate the macro to allow for different popup windows.
Within one Worksheet_Change macro, I have seen examples of multiple MsgBoxes based on <,>, similar to CF. However, I would like to see about having 1 box appear if BE16 reaches 25 points and another box to appear if BF16 reaches 25. Is that possible within 1 macro?
Thank you in advance for any assistance offered.
I'm working on a file for our company trainer to jazz up their training class with an Excel game. Within the game, I am counting the number of times a 1 appears within a certain group of cells. Those 1's are hidden and correspond to another group of cells that the trainees can see on the projector. Once the number of 1's within the range adds up to 25, I have a popup window to let the team know they won. (Please see below).
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("BE16")) Is Nothing Then Exit Sub
If Target.Value = "25" Then Exit Sub
MsgBox "CONGRATULATIONS TEAM 1! You are the winners!! "
End Sub
Team 1's points add up in cell BE16 and Team 2's points are tallied in cell BF16. It seems straightforward but I cannot seem to formulate the macro to allow for different popup windows.
Within one Worksheet_Change macro, I have seen examples of multiple MsgBoxes based on <,>, similar to CF. However, I would like to see about having 1 box appear if BE16 reaches 25 points and another box to appear if BF16 reaches 25. Is that possible within 1 macro?
Thank you in advance for any assistance offered.