I have the following code that populates a combo box with data from the 6th column within the workbook Log File.
I'm attampting to add one if not more additional columns to this combo box, specifiaclly i wanted to show column 2 . I changing the column count in the combo box propeties and changed the column width string below to account for the additional columns and it displays fine, a product type and part number, however when i select the part number i want from column 6, the combo box shows the corresponding value from column 2. The data does load correctly to the user form, it just looks strange when the combo box shows the column 2 value, does anyone have an idea how i can show the value from column 6 when selection is made?
Thanks
![]()
Private Sub Userform_Initialize() Dim Sourcewb As Workbook Dim myRng As Range With Me.cbxPlanning .ColumnCount = 6 .ColumnWidths = "0;50;0;0;0;12" 'hide the second column .Clear Set Sourcewb = Workbooks.Open("Log File.xlsm", False, True) With Sourcewb.Worksheets(1) Set myRng = .Range("A2:BV" & .Cells(.Rows.Count, "A").End(xlUp).Row) End With .List = myRng.Value Sourcewb.Close False End With End Sub











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks