Good Afternoon,
I have a listbox that is used on a userform.
The problem i am having is that it seems to set all the visible columns the same width when some can be thinner like in the spreadsheet.
Is there anyway i can use the code below and updae it so i can adjust the columns A, B, C, D, E,F ,G, H, I.
I am not sure what widths they need to be so i will try and work them out later.
I have a listbox that is used on a userform.
The problem i am having is that it seems to set all the visible columns the same width when some can be thinner like in the spreadsheet.
Is there anyway i can use the code below and updae it so i can adjust the columns A, B, C, D, E,F ,G, H, I.
I am not sure what widths they need to be so i will try and work them out later.
Rich (BB code):
Private Sub UserForm_Initialize()
Dim Today
Today = Format(Now, "dd/mm/yyyy")
Me.TextBox1.Value = Today
Me.TextBox1.Locked = True
Dim wbData As Workbook
Dim wsStats As Worksheet
Application.ScreenUpdating = False
Set wbData = Workbooks.Open(Filename:="C:\Users\MAZZA\Documents\Gavin\Car Park\Data.xls") 'Home
'Workbooks.Open Filename:="\\W2K6082\COMMON\SHARED\Gavin Mazza\Car Park\Data.xls"
Set wsStats = wbData.Worksheets("Stats")
With wsStats.Range("A8:I31")
ListBox1.ColumnCount = .Columns.Count
ListBox1.List = .Value
End With
End Sub