![]() |
Using a combo box in an Excel form
I'm experienced with Excel & VBA, but new to using Excel to create a form.
I would like to simply use a cell as a drop down. Not knowing if that is possible, I have added a combo box to the spreasheet, but I am unclear how the data entered/selected in the drop down will be stored. Is it stored as a VB variable associated with the control or do I link the control to a cell to store the data? To define the values in the drop down/combo box, do I have to use cell references or can I write in the values in the properties (writing them in hasn't worked for me)? Finally, what property do I have to set for the combo box (ActiveX control) to automatically move & size with the cell? Direct answers, links to web sites, any help is greatly appreciated. Thanks in advance. |
Hi
the easiest way to get a drop down in a cell is to use data / validation - Debra Dalgleish has great notes on her site at www.contextures.com/tiptech.html ... look for Data Validation - Basics and then all the other stuff you can do with it. Cheers JulieD "xlcharlie" wrote in message ... I'm experienced with Excel & VBA, but new to using Excel to create a form. I would like to simply use a cell as a drop down. Not knowing if that is possible, I have added a combo box to the spreasheet, but I am unclear how the data entered/selected in the drop down will be stored. Is it stored as a VB variable associated with the control or do I link the control to a cell to store the data? To define the values in the drop down/combo box, do I have to use cell references or can I write in the values in the properties (writing them in hasn't worked for me)? Finally, what property do I have to set for the combo box (ActiveX control) to automatically move & size with the cell? Direct answers, links to web sites, any help is greatly appreciated. Thanks in advance. |
If you just need a dropdown to select an item from a list you won't need any
VBA http://www.contextures.com/xlDataVal01.html -- Regards, Peo Sjoblom "xlcharlie" wrote in message ... I'm experienced with Excel & VBA, but new to using Excel to create a form. I would like to simply use a cell as a drop down. Not knowing if that is possible, I have added a combo box to the spreasheet, but I am unclear how the data entered/selected in the drop down will be stored. Is it stored as a VB variable associated with the control or do I link the control to a cell to store the data? To define the values in the drop down/combo box, do I have to use cell references or can I write in the values in the properties (writing them in hasn't worked for me)? Finally, what property do I have to set for the combo box (ActiveX control) to automatically move & size with the cell? Direct answers, links to web sites, any help is greatly appreciated. Thanks in advance. |
what about if I want to set up a default value for the drop-down? Data
validation does not default to a particular selection. "Peo Sjoblom" wrote: If you just need a dropdown to select an item from a list you won't need any VBA http://www.contextures.com/xlDataVal01.html -- Regards, Peo Sjoblom "xlcharlie" wrote in message ... I'm experienced with Excel & VBA, but new to using Excel to create a form. I would like to simply use a cell as a drop down. Not knowing if that is possible, I have added a combo box to the spreasheet, but I am unclear how the data entered/selected in the drop down will be stored. Is it stored as a VB variable associated with the control or do I link the control to a cell to store the data? To define the values in the drop down/combo box, do I have to use cell references or can I write in the values in the properties (writing them in hasn't worked for me)? Finally, what property do I have to set for the combo box (ActiveX control) to automatically move & size with the cell? Direct answers, links to web sites, any help is greatly appreciated. Thanks in advance. |
Hi Charlie
once you've set up data validation, type the "default" value in the cell. - if you're using this workbook as a template it will always be there. Cheers JulieD "xlcharlie" wrote in message ... what about if I want to set up a default value for the drop-down? Data validation does not default to a particular selection. "Peo Sjoblom" wrote: If you just need a dropdown to select an item from a list you won't need any VBA http://www.contextures.com/xlDataVal01.html -- Regards, Peo Sjoblom "xlcharlie" wrote in message ... I'm experienced with Excel & VBA, but new to using Excel to create a form. I would like to simply use a cell as a drop down. Not knowing if that is possible, I have added a combo box to the spreasheet, but I am unclear how the data entered/selected in the drop down will be stored. Is it stored as a VB variable associated with the control or do I link the control to a cell to store the data? To define the values in the drop down/combo box, do I have to use cell references or can I write in the values in the properties (writing them in hasn't worked for me)? Finally, what property do I have to set for the combo box (ActiveX control) to automatically move & size with the cell? Direct answers, links to web sites, any help is greatly appreciated. Thanks in advance. |
Nevermind, I think I found my answer.
"Peo Sjoblom" wrote: If you just need a dropdown to select an item from a list you won't need any VBA http://www.contextures.com/xlDataVal01.html -- Regards, Peo Sjoblom "xlcharlie" wrote in message ... I'm experienced with Excel & VBA, but new to using Excel to create a form. I would like to simply use a cell as a drop down. Not knowing if that is possible, I have added a combo box to the spreasheet, but I am unclear how the data entered/selected in the drop down will be stored. Is it stored as a VB variable associated with the control or do I link the control to a cell to store the data? To define the values in the drop down/combo box, do I have to use cell references or can I write in the values in the properties (writing them in hasn't worked for me)? Finally, what property do I have to set for the combo box (ActiveX control) to automatically move & size with the cell? Direct answers, links to web sites, any help is greatly appreciated. Thanks in advance. |
All times are GMT +1. The time now is 06:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com