#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default msg box

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default msg box

Scott,

Reponse = MsgBox(Msg, Style, Title) ....Response is spelt wrong.
Are you using Option Explicit?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default msg box

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


"sip8316" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default msg box

Thanks Guys,

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

Scott

"sip8316" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default msg box

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

HTH. Best wishes Harald

"sip8316" skrev i melding
...
Thanks Guys,

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

and
missed that

Scott





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"