ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combobox Population (https://www.excelbanter.com/excel-programming/445541-combobox-population.html)

Greg B[_18_]

Combobox Population
 
Hi All,

I need to fill a combobox with data I have on a sheet called stock. The part
numbers are in Column A. What I would like is populate with the correct
amount. I assume if I used the whole column the combobox fill would be huge.




Vacuum Sealed

Combobox Population
 
On 21/03/2012 11:30 PM, Greg B wrote:
Hi All,

I need to fill a combobox with data I have on a sheet called stock. The part
numbers are in Column A. What I would like is populate with the correct
amount. I assume if I used the whole column the combobox fill would be huge.



Hi Greg

Are you talking about a Userform Combobox or a Data Validation Dropdown
List?

Mick.

Greg B[_18_]

Combobox Population
 
userform sorry forgot that part

"Vacuum Sealed" wrote in message
ond.com...
On 21/03/2012 11:30 PM, Greg B wrote:
Hi All,

I need to fill a combobox with data I have on a sheet called stock. The
part
numbers are in Column A. What I would like is populate with the correct
amount. I assume if I used the whole column the combobox fill would be
huge.



Hi Greg

Are you talking about a Userform Combobox or a Data Validation Dropdown
List?

Mick.




Vacuum Sealed

Combobox Population
 
On 22/03/2012 12:06 AM, Greg B wrote:
userform sorry forgot that part

"Vacuum wrote in message
ond.com...
On 21/03/2012 11:30 PM, Greg B wrote:
Hi All,

I need to fill a combobox with data I have on a sheet called stock. The
part
numbers are in Column A. What I would like is populate with the correct
amount. I assume if I used the whole column the combobox fill would be
huge.



Hi Greg

Are you talking about a Userform Combobox or a Data Validation Dropdown
List?

Mick.



Hmm, sorry! that be my achille's heel in that I haven't had the need to
do any Userform work thus have little knowledge in this area.

Cheers
Mick.

GS[_2_]

Combobox Population
 
Greg B expressed precisely :
Hi All,

I need to fill a combobox with data I have on a sheet called stock. The part
numbers are in Column A. What I would like is populate with the correct
amount. I assume if I used the whole column the combobox fill would be huge.


Explain what you mean by "the combobox fill would be huge". Are there
duplicate part numbers or just lots of them? (I assume you don't want
blanks!)

Do you want to load the combobox with a specific number of items at a
time and provide controls for stepping through all items by moving in
next-in-line?

Do you want a sorted list?

Would a listbox possibly serve you better since users could simply
click an item as apposed to opening the list and navigating it to
select an item? (Note that a combobox will cycle through all entries
that begin with the first letter typed, and so may be the better tool
for the job at hand)

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



davesexcel[_136_]

Combobox Population
 
Assuming you know how to create a userform, this would be the code to populate it with items from Column A

'----------------------------------------
Private Sub CommandButton1_Click()

Range("C1") = ComboBox1
Unload Me

End Sub

Private Sub UserForm_Initialize()

Dim Rws As Long, Rng As Range

Rws = Cells(Rows.Count, "A").End(xlUp).Row

Set Rng = Range(Cells(2, 1), Cells(Rws, 1))

ComboBox1.List = Rng.Value

End Sub
'---------------------------------------------

Check this out to learn how to create a UserForm. Insert a combobox instead of a textbox in the example.
http://www.davesexcel.com/createauserform.htm
Here is an example
http://www.davesexcel.com/Populate%2...0userform.xlsm


Greg B[_18_]

Combobox Population
 
Thank you for the answers.
Greg
"davesexcel" wrote in message
news:8064778.146.1332458365000.JavaMail.geo-discussion-forums@pbctp7...
Assuming you know how to create a userform, this would be the code to
populate it with items from Column A

'----------------------------------------
Private Sub CommandButton1_Click()

Range("C1") = ComboBox1
Unload Me

End Sub

Private Sub UserForm_Initialize()

Dim Rws As Long, Rng As Range

Rws = Cells(Rows.Count, "A").End(xlUp).Row

Set Rng = Range(Cells(2, 1), Cells(Rws, 1))

ComboBox1.List = Rng.Value

End Sub
'---------------------------------------------

Check this out to learn how to create a UserForm. Insert a combobox
instead of a textbox in the example.
http://www.davesexcel.com/createauserform.htm
Here is an example
http://www.davesexcel.com/Populate%2...0userform.xlsm





All times are GMT +1. The time now is 06:13 PM.

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