Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The ComboBox can pick up the descriptions along the item numbers. That
will make it easier to get the description for a given item number. The user doesn't have to see it. Set the ComboBox's ColumnCount to 2 and the 2nd column's width to 0, e.g. ColumnWidths = 30 pts; 0 pts. I assume you have a CommandButton the user clicks to indicate having selected an Item Number and quantity. Assuming this, something like the following code should work. Private Sub CommandButton1_Click() Dim iRow As Integer iRow = 1 + Sheets("Order").Range("A65536").End(xlUp).Row Sheets("Order").Cells(iRow, 1) = ComboBox1.List(ComboBox1.ListIndex, 0) Sheets("Order").Cells(iRow, 2) = CInt(TextBox1.Value) Sheets("Order").Cells(iRow, 3) = ComboBox1.List(ComboBox1.ListIndex, 1) End Sub Private Sub UserForm_Activate() Dim iCt As Integer Dim r As Range iCt = Sheets("Items").Range("M1") Set r = Sheets("Items").Range("A3:B" & iCt + 2) ComboBox1.RowSource = r.Worksheet.Name & "!" & r.Address End Sub Hth, Merjet |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating a ComboBox in a UserForm | Excel Programming | |||
Populating a ComboBox | Excel Programming | |||
Populating Combobox Methods | Excel Programming | |||
populating a combobox on a worksheet | Excel Programming |