combo box in excel + VB

sbrajagopal7

New Member
Joined
Jun 28, 2014
Messages
2
Hi,

1. I have placed couple of Combox boxes with Activex control.
2. I have linked the cells to display "OJT" and "P2P" in cobo box 1.
My Question
3. If i select "OJT" in combo box1 it has to load "Windows" "Intel" "VMware" in combo box2.
4. If i select "P2P" in combo box1 it has to load "Incoming" "Storage" "WebLogic" in combo box2.
How can i do this..I am using MsOffice 2010.
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,384
  • Right-click on the sheet tab that has the combobxes
  • Select View Code from the pop-up context menu
  • Paste the code from below into the worksheet's code module

Code:
[COLOR=darkblue]Private[/COLOR] [COLOR=darkblue]Sub[/COLOR] ComboBox1_Change()
    ComboBox2.Clear
    [COLOR=darkblue]Select[/COLOR] [COLOR=darkblue]Case[/COLOR] ComboBox1.ListIndex
        [COLOR=darkblue]Case[/COLOR] [COLOR=darkblue]Is[/COLOR] = 0: ComboBox2.List = Array("Windows", "Intel", "VMware")
        [COLOR=darkblue]Case[/COLOR] [COLOR=darkblue]Is[/COLOR] = 1: ComboBox2.List = Array("Incoming", "Storage", "WebLogic")
    [COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Select[/COLOR]
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]
 

sbrajagopal7

New Member
Joined
Jun 28, 2014
Messages
2
  • Right-click on the sheet tab that has the combobxes
  • Select View Code from the pop-up context menu
  • Paste the code from below into the worksheet's code module

Code:
[COLOR=darkblue]Private[/COLOR] [COLOR=darkblue]Sub[/COLOR] ComboBox1_Change()
    ComboBox2.Clear
    [COLOR=darkblue]Select[/COLOR] [COLOR=darkblue]Case[/COLOR] ComboBox1.ListIndex
        [COLOR=darkblue]Case[/COLOR] [COLOR=darkblue]Is[/COLOR] = 0: ComboBox2.List = Array("Windows", "Intel", "VMware")
        [COLOR=darkblue]Case[/COLOR] [COLOR=darkblue]Is[/COLOR] = 1: ComboBox2.List = Array("Incoming", "Storage", "WebLogic")
    [COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Select[/COLOR]
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]

Thank you very much...it worked :)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,912
Messages
5,598,833
Members
414,260
Latest member
joishe

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
Top