Code:
Private Sub UserForm_Initialize()
'Set the range of the Agency table
With Worksheets("Reference")
Set rgAgencies = .Range(.Cells(2, 23), .Cells(Agency_Count, 23))
End With
ActiveWorkbook.Names.Add Name:="Agency_List", RefersTo:=rgAgencies
Me.list_Agencies.RowSource = Worksheets("Reference").Range("Agency_List").Address
End Sub
The named range (Agency_List) is in the REFERENCE worksheet. When the Reference worksheet is active and I run the form, the listbox loads with the list.
However, when the CANDIDATE worksheet is active, the form opens but the listbox on the form will not load. The form will be initialised when I am in the CANDIDATE worksheet.
What am I doing wrong ?