Below is the code I created:
Private Sub UserForm_Activate()
Dim Total_rows_PU As Long
Total_rows_PU = Workbooks("Revised-Payroll (VBA Copy).xlsm").Worksheets("Payroll Update").Range("A" & Rows.Count).End(xlUp).Row
Me.cbxName.List = Worksheets("Payroll Update").Range("A2:A" & Total_rows_PU)
End Sub
This is the error I receive:
This is where the error occurs:
Working solution after considering the answer below:
Private Sub UserForm_Initialize()
Total_rows_PU = Workbooks("Revised-Payroll (VBA Copy).xlsm").Worksheets("Payroll Update").Range("A" & Rows.Count).End(xlUp).Row
Dim cell As Range
For Each cell In Range("A2:A" & Total_rows_PU)
Me.cbxName.AddItem cell.Value
Next
End Sub