'Yes' 'No' buttons in auto-open macro

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

Guest

I have an autoopen MsgBox macro created. Instead of the "OK" button, I want the user to choose between "Yes" and "No" buttons. Yes=a pathway to a designated network drive and folder, No=remain on current worksheet. Q1. Syntax to instruct Excel to include Yes and No buttons in the MsgBox prompt. Q2. Syntax to instruct Excel what to do when either button is clicked. Thank you for any help you may offer. Your expertise is greatly appreciated.
 
As usual, post your code but maybe an inputbox would help.

--
Don Guillett
SalesAid Software
(e-mail address removed)
Larry said:
I have an autoopen MsgBox macro created. Instead of the "OK" button, I
want the user to choose between "Yes" and "No" buttons. Yes=a pathway to a
designated network drive and folder, No=remain on current worksheet. Q1.
Syntax to instruct Excel to include Yes and No buttons in the MsgBox prompt.
Q2. Syntax to instruct Excel what to do when either button is clicked.
Thank you for any help you may offer. Your expertise is greatly
appreciated.
 
Look in the VBA help for vbYesNo
also don't you think this should have been posted in programming, it's
hardly
a function question?

--


For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom

Larry said:
I have an autoopen MsgBox macro created. Instead of the "OK" button, I
want the user to choose between "Yes" and "No" buttons. Yes=a pathway to a
designated network drive and folder, No=remain on current worksheet. Q1.
Syntax to instruct Excel to include Yes and No buttons in the MsgBox prompt.
Q2. Syntax to instruct Excel what to do when either button is clicked.
Thank you for any help you may offer. Your expertise is greatly
appreciated.
 
Sub Test()
Select Case MsgBox("HookaHey", vbYesNo)
Case vbYes
MsgBox "I'll be back"
Case Else
MsgBox "Here's looking at you"
End Select
End Sub


HTH. Best wishes Harald

Larry said:
I have an autoopen MsgBox macro created. Instead of the "OK" button, I
want the user to choose between "Yes" and "No" buttons. Yes=a pathway to a
designated network drive and folder, No=remain on current worksheet. Q1.
Syntax to instruct Excel to include Yes and No buttons in the MsgBox prompt.
Q2. Syntax to instruct Excel what to do when either button is clicked.
Thank you for any help you may offer. Your expertise is greatly
appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top