Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB in EXCEL 1

Status
Not open for further replies.

giggs11

Programmer
Dec 5, 2001
21
CA
Basically I have a combo box with items: Approved, Declined, Cancelled. What I want to do is prompt the user/ remind the user to select a Decline Reason when Declined is selected from the box. Does anyone know how to do this?
 
Put the following in the first comboboxes _Change event (change both combobox names to match yours):

Code:
Private Sub ComboBox1_Change()
If ComboBox1.Value = "Declined" Then
   MsgBox "Please select reason declined."
   ComboBox2.Visible = True
End If
End Sub
Hope that does it for you!


VBAjedi [swords]
 
giggs,

I notice that you've been a member since Dec 2001 and have received several helpful posts.

Perhaps you did not realize that we recognize Mark this post as a helpful/expert post!
not only to thank the contributor for their help, but also to indicate to other menbers that the post was indeed helpful or expert.

Please be sure to let VBAjedi know if this post rose to meet these expectations.

:)

Skip,
Skip@TheOfficeExperts.com
 
VBAjedi,

Thanks for your help but the combobox2 still appears but is in a smaller font. I changed the properties to Visible=false. And used the code you wrote. What should I do?
 
Skip,
you can lead a programmer to free code solutions but you can't make him click a simple link... ;0P
go figure...

Sam
 
Don't mind Sam's ribbing. Almost without exception we like to help people figure stuff out in here - we just like to have some fun along the way!

I take it you want the second combobox to be hidden unless it is needed. To accomplish that you should set the comboboxes default visible property to false (the location of that option varies depending on whether the combobox is on a spreadsheet or on a form). Use my code above to make it visible if/when needed. You will probably also want to write a short "Reset" sub that deletes any values and rehides the second combobox.

VBAjedi [swords]
 
giggs11,
Like VBAjedi said, don't mind me. I had no intention to offend just having a bit of fun.
Cheers!

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top