ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Form Question (https://www.excelbanter.com/excel-programming/387611-user-form-question.html)

[email protected]

User Form Question
 
Hi there

I need to implement a user form that let's the user pick one of five
cases (basic, increased, decreased, superior, inferior) and when each
is picked, it runs a macro that changes specific cells. I have all
the macros recorded and saved, I am just clueless as to how to get the
list inside of the combo box and then have the macros executed. Any
help would be greatly appreciated!

Thank you


Norman Jones

User Form Question
 
Hi Alex,

Try something like:

'=============
Private Sub ComboBox1_Change()
Select Case Me.ComboBox1.Value
Case "basic": Call Macro1
Case "increased": Call Macro2
Case "decreased": Call Macro3
Case "superior": Call Macro4
Case "inferior": Call Macro5
End Select
End Sub

'------------------
Private Sub UserForm_Initialize()
With Me.ComboBox1
.AddItem "basic"
.AddItem "increased"
.AddItem "decreased"
.AddItem "superior"
.AddItem "inferior"
End With
End Sub
'<<=============


---
Regards,
Norman


wrote in message
ups.com...
Hi there

I need to implement a user form that let's the user pick one of five
cases (basic, increased, decreased, superior, inferior) and when each
is picked, it runs a macro that changes specific cells. I have all
the macros recorded and saved, I am just clueless as to how to get the
list inside of the combo box and then have the macros executed. Any
help would be greatly appreciated!

Thank you





All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com