Hi all,
The following code initialized data in a listbox on a Userform.
One of the columns in range E5:E1000 contain True and False statements.
In the listbox however they are rendered as 0 and -1.
I need them to be shown as "True" and False".
Is there a way to accomplish this?
The following code initialized data in a listbox on a Userform.
One of the columns in range E5:E1000 contain True and False statements.
In the listbox however they are rendered as 0 and -1.
I need them to be shown as "True" and False".
Is there a way to accomplish this?
Code:
Private Sub UserForm_Initialize()
Dim lbtarget As MSForms.ListBox
Dim rngSource As Range
Set rngSource = Sheets("A").Range("E5", Sheets("A").Range("A5").End(xlDown))
Set lbtarget = Me.ListBox1
With lbtarget
.ColumnCount = 5
.ColumnWidths = "0;40;150;120;50"
.List = rngSource.Cells.Value
End With
ListBox1.ListIndex = 0
End Sub