Under the Name Manager in Excel I have created 3 different named ranges (AREPLIST, FREPLIST, and SREPLIST) which include real names to populate a ListBox on a UserForm. (lstReps). On the same UserForm I have 3 option buttons, one for each named range. The ListBox is already designated with the RowSource of SREPLIST and its matching option button already selected. When another option button is selected, the ListBox should repopulate with the names from the corresponding list. Here is the code I have for repopulating with the AREPLIST:
Private Sub optAftermarket_Click()
Dim reprange As Range
Set reprange = ActiveWorkbook.Names("AREPLIST").RefersToRange
lstReps.List = reprange
End Sub
When optAftermarket is selected I get this message: Run-time error '13': Type Mismatch
I have tried several variations of code to complete this task, but to no avail. I am confused as to where this mismatch occurs and how to make this task functional.