Dear Excel Master
I tried to change the ColumnWidths some case are OK and some are not, if any Excel Master know the deep reason of how it's got error, please let me know. Thanks!
I tried to change the ColumnWidths some case are OK and some are not, if any Excel Master know the deep reason of how it's got error, please let me know. Thanks!
Code:
Private Sub UserForm_Initialize()
Dim i As Long
Dim j As Long
Dim lgRow As Long
Dim asgTestData
someListBox.ColumnCount = 3
lgRow = 5
ReDim asgTestData(lgRow, someListBox.ColumnCount) As String
For j = 0 To someListBox.ColumnCount - 1
For i = 0 To lgRow - 1
asgTestData(i, j) = "Row " & i & ", Column " & j
Next i
Next j
someListBox.List() = asgTestData
Private Sub TestColumnWidths_Click()
someListBox.ColumnWidths = "10;20;30" 'is OK
someListBox.ColumnWidths = "10pt;20pt;30pt" 'is OK
someListBox.ColumnWidths = "1cm;2cm;3cm" 'is error
someListBox.ColumnWidths = "1in;2in;3in" 'is error
End Sub