Message Box on Drop Down Selection

leighjones123

New Member
Joined
Aug 12, 2011
Messages
49
Office Version
  1. 365
Platform
  1. MacOS
Hi All

I've got a user form in VB/Excel. When the user selects one of the options, i need a message box to pop up to give them information.

How would i go about this?

I'm very much a VB Beginner!

Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
You'd put your code in the 'Change' event

Code:
Private Sub ComboBox1_Change()
 
'Your code such as...
MsgBox "You selected an item!"
 
End Sub

Regards
Adam
 
Upvote 0
Adam

That's great thankyou - quick query.

Is there any way i can get it to only pop up when a particular option on my dropdown has been selected?

Many thanks for your quick response,

Leigh
 
Upvote 0
Yeah. You'll want to play with it but try looking at...

Code:
Private Sub ComboBox1_Change()
 
Select Case ComboBox1
 
Case "Hello"
MsgBox "You clicked Hello!"
 
Case "Goodbye"
MsgBox "You clicked Goodbye!"
 
Case "Do Nothing"
'Do nothing
 
Case Else
MsgBox "You clicked something else!"
 
End Select
 
End Sub

Regards
Adam
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top