Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box
Hi, i have information in one of my excel spreadsheet combo Box
(please see below) SD - South Distance WD - West Distance ND - North Distancce is it possible that when i click drop down in combo box then i can see all the information which i mentioned above and when i select one of it like if i select SD - South Distance then after selecting it i just see SD in combo box. I just want to see all information in dropdown but i want first two words to show in combo box after selecting it. Please if anybody can give any useful idea. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box
This is a combobox from the control toolbox toolbar placed on a worksheet?
If yes, you can make the combobox show two columns in the list, but only one boundcolumn will show up in the combobox. Option Explicit Sub auto_open() With Worksheets("Sheet1").ComboBox1 .ColumnCount = 2 .BoundColumn = 1 .ListFillRange = "" .Clear .ColumnWidths = "25;55" .AddItem "SD" .List(0, 1) = "South Distance" .AddItem "WD" .List(1, 1) = "West Distance" .AddItem "ND" .List(2, 1) = "North Distancce" End With End Sub I populated the combobox in the auto_open procedure--this goes in a General module and will run each time you open your workbook. But you could have done it manually through the properties window, too (with a two column range somewhere in your workbook). K wrote: Hi, i have information in one of my excel spreadsheet combo Box (please see below) SD - South Distance WD - West Distance ND - North Distancce is it possible that when i click drop down in combo box then i can see all the information which i mentioned above and when i select one of it like if i select SD - South Distance then after selecting it i just see SD in combo box. I just want to see all information in dropdown but i want first two words to show in combo box after selecting it. Please if anybody can give any useful idea. Thanks. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box
On 30 Jan, 20:23, Dave Peterson wrote:
This is a combobox from the control toolbox toolbar placed on a worksheet? If yes, you can make the combobox show two columns in the list, but only one boundcolumn will show up in the combobox. Option Explicit Sub auto_open() * * With Worksheets("Sheet1").ComboBox1 * * * * .ColumnCount = 2 * * * * .BoundColumn = 1 * * * * .ListFillRange = "" * * * * .Clear * * * * .ColumnWidths = "25;55" * * * * .AddItem "SD" * * * * .List(0, 1) = "South Distance" * * * * .AddItem "WD" * * * * .List(1, 1) = "West Distance" * * * * .AddItem "ND" * * * * .List(2, 1) = "North Distancce" * * End With End Sub I populated the combobox in the auto_open procedure--this goes in a General module and will run each time you open your workbook. But you could have done it manually through the properties window, too (with a two column range somewhere in your workbook). K wrote: Hi, i have information in one of my excel spreadsheet combo Box (please see below) SD - South Distance WD - West Distance ND - North Distancce is it possible that when i click drop down in combo box then i can see all the information which i mentioned above and when i select one of it like if i select SD - South Distance then after selecting it i just see SD in combo box. *I just want to see all information in dropdown but i want first two words to show in combo box after selecting it. Please if anybody can give any useful idea. Thanks. -- Dave Peterson- Hide quoted text - - Show quoted text - Thanks for replying Dave. i am trying to use Combo Box (from control). i know there is another Combo Box(Active X control). Can you please explain bit more that where and how i should place the code you send me. And is it possible for you that you can see the link below and send me any use ful answer for it thanks. http://www.savefile.com/files/1350632 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box
First, I don't open unknown workbooks.
Second, do you mean you used a dropdown from the Forms toolbar? If you did, you'll want to replace it with a combobox from the control toolbox toolbar. Third... If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm K wrote: On 30 Jan, 20:23, Dave Peterson wrote: This is a combobox from the control toolbox toolbar placed on a worksheet? If yes, you can make the combobox show two columns in the list, but only one boundcolumn will show up in the combobox. Option Explicit Sub auto_open() With Worksheets("Sheet1").ComboBox1 .ColumnCount = 2 .BoundColumn = 1 .ListFillRange = "" .Clear .ColumnWidths = "25;55" .AddItem "SD" .List(0, 1) = "South Distance" .AddItem "WD" .List(1, 1) = "West Distance" .AddItem "ND" .List(2, 1) = "North Distancce" End With End Sub I populated the combobox in the auto_open procedure--this goes in a General module and will run each time you open your workbook. But you could have done it manually through the properties window, too (with a two column range somewhere in your workbook). K wrote: Hi, i have information in one of my excel spreadsheet combo Box (please see below) SD - South Distance WD - West Distance ND - North Distancce is it possible that when i click drop down in combo box then i can see all the information which i mentioned above and when i select one of it like if i select SD - South Distance then after selecting it i just see SD in combo box. I just want to see all information in dropdown but i want first two words to show in combo box after selecting it. Please if anybody can give any useful idea. Thanks. -- Dave Peterson- Hide quoted text - - Show quoted text - Thanks for replying Dave. i am trying to use Combo Box (from control). i know there is another Combo Box(Active X control). Can you please explain bit more that where and how i should place the code you send me. And is it possible for you that you can see the link below and send me any use ful answer for it thanks. http://www.savefile.com/files/1350632 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combo reference on another combo box for picking address etc. | Excel Worksheet Functions | |||
Excel VBA Combo Box Populating dependent on other combo box choices | Excel Programming | |||
Filtered list for Combo Box ListFillRange - Nested Combo Boxes | Excel Programming | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) |