I am trying to find the correct VBA syntax to populate a listbox (on an Excel userform) with column headings, from a table reference.
The following code works but does not display column headings:
******************************************************************************************
Dim reqmstrRnge As Range
Set reqmstrRnge = ThisWorkbook.Worksheets("DataTbl").Range("tbl_ReqLogMstr")
.lstDatabase.ColumnCount = 16
.lstDatabase.ColumnHeads = True
.lstDatabase.List = reqmstrRnge.Cells.Value
*****************************************************************************************
I originally used .rowsource before I converted the data sheet into a table. I assume I'm not using correct syntax or table references don't work with .rowsource.
I have not been able to find anything on the web for this that works.
Any thoughts?
The following code works but does not display column headings:
******************************************************************************************
Dim reqmstrRnge As Range
Set reqmstrRnge = ThisWorkbook.Worksheets("DataTbl").Range("tbl_ReqLogMstr")
.lstDatabase.ColumnCount = 16
.lstDatabase.ColumnHeads = True
.lstDatabase.List = reqmstrRnge.Cells.Value
*****************************************************************************************
I originally used .rowsource before I converted the data sheet into a table. I assume I'm not using correct syntax or table references don't work with .rowsource.
I have not been able to find anything on the web for this that works.
Any thoughts?