https://excelmate.wordpress.com/2012...-boxes-part-3/
The above article/site is very informative but when I mimic the example 100%, 4 lines of red are produced in the code, stating that something is not right.
Essentially the aim is to use the below code:
Sub RespondToMessage()
Dim Reply as Byte
Reply = MsgBox (“Please select a button”, vbYesNoCancel + vbQuestion _ ,“Respond”)
Select Case Reply
Case Is = 6
MsgBox “You selected ‘Yes’”, , “Well done!”
Case Is = 7
MsgBox “You selected ‘No’”, , “Well done!”
Case Is = 2
MsgBox “You selected ‘Cancel’”, , “Well done!”
End Select
End Sub
Which will produce the below message boxes when the various buttons are clicked:
13a.jpg
However, when the code is entered in a module, 4 lines are red as shown below:
13b.JPG
What do you think is wrong here?
Bookmarks