I am using listboxes to display data in userforms in word. However I am not able to set header captions or figure out how to make it possible to click on the header to sort by that column.
GUI.Search_ListBox.Clear
GUI.Search_ListBox.ColumnCount = 5 ' Columns
GUI.Search_ListBox.ColumnWidths = "120;80;70;120;300"
GUI.Search_ListBox.ColumnHeads = True
'GUI.Search_ListBox.RowSource = "Hello;gkjfl;hsjgh;hdfjhgkj;fdjghjkdf" 'here it fails!!!
Best Answer
With VBA, simply set the
ListBox.ColumnHeads
Property toTrue
.Alternatively, you can also change the setting in the ActiveX control's
Properties
dialog:If the button is disabled on the ribbon, you'll have to enter first.
More Information:
EDIT:
You need to specify the headings in the rowsource: