Selected Answer
@Tubrak,
Another thing (error) I noticed is it seems you are wanting to assign a range object to " a ". If so, you should declare " a " as a Range and not a Variant.
You have declared a variable "LastRow" but have not given it a value. Add this line:
LastRow = Range("A" & Rows.Count).End(xlUp).Row
My suggestion for your code is:
Private Sub UserForm_Initialize()
Dim LastRow As Long
Set sh = Sheets("ATS")
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set a = sh.Range("A2:E" & LastRow)
With MY_List
' 6 columns but 7 widths ??
.ColumnCount = 6
.ColumnWidths = "20;50;100;100;70;70;70"
End With
End Sub
You also state "ColumnCount = 6" but the next line has
7 widths
Hope this helps. If this solves your problem, please mark my answer as selected.
Cheers :-)