My code below that I’m currently using doesn’t allow me to have / adjust column widths.
Sometimes the value in my listbox is cut off because of this.
Please can you advise me a code so I can adjust columns widths to suit where at present I have no control.
Thanks.
>>> use code - tags <<<
Sometimes the value in my listbox is cut off because of this.
Please can you advise me a code so I can adjust columns widths to suit where at present I have no control.
Thanks.
>>> use code - tags <<<
Code:
Private Sub UserForm_Activate()
Dim dic1 As Object, dic2 As Object, dic3 As Object
Dim i As Long
Set dic1 = CreateObject("Scripting.Dictionary")
Set dic2 = CreateObject("Scripting.Dictionary")
Set dic3 = CreateObject("Scripting.Dictionary")
a = Range("A1:G" & Range("D" & Rows.Count).End(3).Row).Value
ListBox1.ColumnCount = 7
'first column D second column F & third column G
For i = 2 To UBound(a, 1)
dic1(Range("D" & i).Value) = Empty
dic2(Range("F" & i).Value) = Empty
dic3(Range("G" & i).Value) = Empty
Next
ComboBox1.List = dic1.keys
ComboBox2.List = dic2.keys
ComboBox3.List = dic3.keys
End Sub
Last edited by a moderator: