Peter Thompson
Active Member
- Joined
- Dec 15, 2008
- Messages
- 262
Hello,
I have been trying to run the code below to get a list box in a user formto be populated from a named range (called Requestors) in a worksheet (Report_Sheet) but I keep getting errors when I try and run it. The top few lines work fine but when it goes to the with statement it gets an error.
Can anyone see whats going wrong?
Private Sub UserForm_Initialize()
Dim vListSource As Variant
Dim wksRepSheet As Worksheet
Set wksRepSheet = Worksheets("Report_Sheet")
With wksRepSheet.Names("Requestor")
vListSource = .RefersToRange.Value
End With
frmBriefing.ListBox1.List = vListSource
End Sub
I have been trying to run the code below to get a list box in a user formto be populated from a named range (called Requestors) in a worksheet (Report_Sheet) but I keep getting errors when I try and run it. The top few lines work fine but when it goes to the with statement it gets an error.
Can anyone see whats going wrong?
Private Sub UserForm_Initialize()
Dim vListSource As Variant
Dim wksRepSheet As Worksheet
Set wksRepSheet = Worksheets("Report_Sheet")
With wksRepSheet.Names("Requestor")
vListSource = .RefersToRange.Value
End With
frmBriefing.ListBox1.List = vListSource
End Sub