0
votes

I am trying to set up the row source for a combo box in Excel VBA but is returning the error

1004 Method 'Range' of object '_Global' failed.

Private Sub UserForm_Initialize()

    Dim rngVendor As Range

    Set rngVendor = Worksheets("Lists").Range("N2:N" & _
    Range("N2").End(xlDown).Row)

    frmNewVendor.cboVendor.RowSource = Range(rngVendor)

End Sub
1

1 Answers

2
votes

rngVendor is declared as a range so it doesn't need the Range function

 frmNewVendor.cboVendor.RowSource = rngVendor