Use Named Range to Populate Userform Combobox

KBSpec

New Member
Joined
Aug 12, 2014
Messages
17
Hi All,

I've been combing the web and trying to work this out on my own, but I have to admit I need your help. I've created a named dynamic range that I have successfully pulled into a combobox in a worksheet. What I really want to do is use it in a userform combobox in the same workbook. I just can't seem to figure out the syntax. Please help.

The Workbook is LAL Test Trending
The dynamic range is called PersonnelDropDown, the source is on a worksheet named Sheet2
The userform is named frmPersonnelCharts
The userform combobox is called comboPersonnelSelection

This is the most recent version of my code trying to use PersonnelDropDown for comboPersonnelSelection:

Sub buttonPersonnelCharts_Click()
'Open frmPersonnelCharts when the Sheet2 cmdPersonnelCharts is clicked
Call frmPersonnelChart_Initialize
frmPersonnelCharts.Show
End Sub

Private Sub frmPersonnelChart_Initialize()

MsgBox "got to initialize the personnel chart form"

comboPersonnelSelection.RowSource = Workbooks("LAL TEST Trending").Names("PersonnelDropDown").RefersToRange

End Sub

I get the message that the code got to initialize the personnel chart form but it crashes on the combobox code RowSource assignment.

Please let me know how to fix this.

Thank you for any and all help.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try this & see if does what you want.

Code:
Private Sub UserForm_Initialize()


MsgBox "got to initialize the personnel chart form"


comboPersonnelSelection.List = Sheets("Sheet2").Range("PersonnelDropDown").Value


End Sub

Note that I have returned the forms Intialize event to its default name value - you should not rename it.

Dave
 
Upvote 0

Forum statistics

Threads
1,223,155
Messages
6,170,405
Members
452,325
Latest member
BlahQz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top