Re: Combo Box MacroQuote from Grimes0332;767705
As an example, how to determine the selected value and display a message for each. One option is ignored, no message displayed.Code
Sub ListSelect() ' ' ListSelecct Macro ' Dim strMsg As String Select Case ActiveSheet.Shapes("Drop Down 2").ControlFormat.List(ActiveSheet.Shapes("Drop Down 2").ControlFormat.ListIndex) Case "Alpha" strMsg = "Good to go" Case "Hotel" strMsg = "Please do something" Case "Zulu", "Yankee" strMsg = ActiveSheet.Shapes("Drop Down 2").ControlFormat.List(ActiveSheet.Shapes("Drop Down 2").ControlFormat.ListIndex) End Select ' One selection ignored - so no messagebox If strMsg <> vbNullString Then MsgBox strMsg, vbInformation End If ' dimSelection = strn ' If strn = "Alpha" Then ' MsgBox "You may proceed" ' End If ' ' ' If strn = D22 Then ' MsgBox "Denied" ' End If End Sub
This is it! Thank you so much! I don't really understand yet how it works but I can make significant progress with this. I'm still learning coding in VBA, thank you for bearing with me. Now all I have to do is find a way to set the list to an empty cell by clicking the Clear button I inserted earlier.
Re: Combo Box Macro
So I messed around with it and was able to generate a message but I'm still a little confused. The message displays regardless of selection. This is what I have so far.
I'm sure this question, or similar has been asked before. What I'm attempting to do is provide the user of the spreadsheet with a list in the form of a drop down. Also, depending on the selection from the list it will display a message box relevant to that selection. To elaborate: If "Alpha" is selected, a message box will appear with something like "Good to Go!" but if "Beta" is selected, the message box will display "N/A Proceed to Cell XX". I, unfortunately don't have much experience coding. I can insert the combo box and link it to a range of cells for the list. I know how to open the VBA window but after that, I'm lost. Thank you in advance for your help!