Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 424
- Office Version
- 365
- Platform
- Windows
- Mobile
I have code to get a range into form listbox but it says run time error 13??
VBA Code:
Private Sub UserForm_Initialize()
Dim wb As Workbook
Dim ws As Worksheet
Dim LRow As Long
Set wb = ActiveWorkbook
Set ws = wb.ActiveSheet
LRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Me.SuppliersName.RowSource = ws.Range("B1:B" & LRow)
Me.SuppliersName.ColumnHeads = True
End Sub