How to fill combobox with values ?

audrey

Active Member
Joined
Jul 30, 2008
Messages
491
Hello,

1. How can I fill the combobox with values ? (EDIT: I did it from Properties)
2. and secondly if chosen value b (among a,b and c) what is the enxt steps to write the macro ?

Thank you
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
2. and secondly if chosen value b (among a,b and c) what is the enxt steps to write the macro ?

What do you want the macro to do?

Note that an easy way to trigger a macro with a list selection is to use a Change event coupled with a Data Validation drop-down box, as opposed to a ComboBox.
 
Upvote 0
well according to the value chosen inside the combobox, few cells will be hidden or revealed. I know the macro hides and unhides the cells, but I forgottten how to choose the value in combobox.
 
Upvote 0
Here's one way:

Code:
Private Sub ComboBox1_Change()
    MsgBox ComboBox1.Value
End Sub

The other way would be

MsgBox [A1].Value

If A1 is your linked cell.
 
Upvote 0
Private Sub ComboBox1_Change()
Select Case ComboBox1.Value
Case "Date"
Call Macro12
Case "Name"
Call Macro13
Case "Type"
Call Macro14
End Select

End Sub

why this one not working ???
 
Upvote 0
What happens?

What does this do for you:

<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> ComboBox1_Change()<br>    <SPAN style="color:#00007F">Select</SPAN> <SPAN style="color:#00007F">Case</SPAN> ComboBox1.Value<br>        <SPAN style="color:#00007F">Case</SPAN> "Date"<br>            MsgBox "Date"<br>            <SPAN style="color:#007F00">'Call Macro12</SPAN><br>        <SPAN style="color:#00007F">Case</SPAN> "Name"<br>            MsgBox "Name"<br>            <SPAN style="color:#007F00">'Call Macro13</SPAN><br>        <SPAN style="color:#00007F">Case</SPAN> "Type"<br>            MsgBox "Type"<br>            <SPAN style="color:#007F00">'Call Macro14</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Select</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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