msg box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used the following code with a command button so that a msg box would pop
up and prompt the user to select yes or no, and then call upon another macro
if yes is chosen. However nothing happens when I click yes or no. Below is
my code and thanks for any help

Scott

Private Sub cmdColors_Click()
Dim Msg, Style, Title, Response, MyString

cmdColors.Enabled = False

Msg = "Depending on the size of the spreadsheet and the speed of your
computer this action may take 1 to 5 min. to complete. Do you want to
continue?"
Style = vbYesNo + vbDefaultButton1
Title = "MsgBox Continue"

Reponse = MsgBox(Msg, Style, Title)
If Response = vbYes Then
Call BorderStandard
Else

End If

cmdColors.Enabled = True
End Sub
 
Scott,

Reponse = MsgBox(Msg, Style, Title) ....Response is spelt wrong.
Are you using Option Explicit?
 
Hi,
Could it be the simple typo in your code:


Reponse = MsgBox(Msg, Style, Title) instead of

ReSponse = MsgBox(Msg, Style, Title)

.... worked OK for me (with change).


HTH
 
Thanks Guys,

I hate it when I do that. I don't know how many times I looked it over and
missed that

Scott
 
Put
Option Explicit
on top of all your modules, and the VB editor will tell you those things.

HTH. Best wishes Harald
 
Back
Top