Hi, I have a problem with my combo box. In the screenshot that I have provided, you can see "Contact Person", "Basic Wage" and "Time Wage". I want these items to fill the header in the combo box. Can someone help me? Thank you.
Here is the code that I use:
Here is the code that I use:
VBA Code:
Public Sub cmFillWorker1(cmName As Object)
Set WbDb = Workbooks("DataBase.xlsx")
Set ShDb = WbDb.Sheets("TbVendors")
' Set WbCd = ThisWorkbook
' Set shCd = WbCd.Sheets("shSummary")
'----------------------------------------------
'load CombBox4 VENDOR NAME mine Setup Unit
Dim rowStart
With cmName
rowStart = 6
.Clear
Do Until ShDb.Cells(rowStart, "d") = ""
.ColumnHeads = True
.columnCount = 4
.ColumnWidths = "106;84;48;0"
.AddItem
.list(.ListCount - 1, 0) = ShDb.Cells(rowStart, "d")
.list(.ListCount - 1, 1) = ShDb.Cells(rowStart, "ac")
.list(.ListCount - 1, 2) = ShDb.Cells(rowStart, "ad")
' .list(.ListCount - 1, 3) = sheet_Setup.Cells(rowStart, "bf")
' .list(.ListCount - 1, 1) = sheet_Setup.Cells(rowStart, "bd")
rowStart = rowStart + 1
Loop
End With
'----------------------------------------------
' WbDb.Close
Set WbDb = Nothing
Set ShDb = Nothing
Set WbCd = Nothing
End Sub