TTom
Well-known Member
- Joined
- Jan 19, 2005
- Messages
- 518
<b>Part 1 of routine:</b> Names range of cells as "rng_EmpSelection"
to be used to populate .rowsource in userform combo box
<b>Part 2 of routine:</b>
1. Populate userform (uf_Emp) combo box's .rowsource from named range in part 1
2. Set rows to display equal to rows populated
3. Display userform with combo box that should have drop down selection from range
<b>Problem:</b> When I run I have nothing in my combo box on down arrow...
Did not populate? Not certain where I messed up even after reading up on 'how to' Thoughts?
<i>The naming of range works as I can select on spreadsheet corner box and it highlights the range. I expect my error is in Part 2.
ListRows and RowSource in ComboBox setup are "0" and "blank" respectively prior to code.</i>
<code>
With Worksheets("Employees")
LastRow = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H2:H" & LastRow).Name = "rng_EmpSelection"
End With
Load uf_Emp
uf_Emp.cbx_EmpSelect.RowSource = "rng_EmpSelection"
uf_Emp.cbx_EmpSelect.ListRows = LastRow
uf_Emp.Show
</code>
to be used to populate .rowsource in userform combo box
<b>Part 2 of routine:</b>
1. Populate userform (uf_Emp) combo box's .rowsource from named range in part 1
2. Set rows to display equal to rows populated
3. Display userform with combo box that should have drop down selection from range
<b>Problem:</b> When I run I have nothing in my combo box on down arrow...
Did not populate? Not certain where I messed up even after reading up on 'how to' Thoughts?
<i>The naming of range works as I can select on spreadsheet corner box and it highlights the range. I expect my error is in Part 2.
ListRows and RowSource in ComboBox setup are "0" and "blank" respectively prior to code.</i>
<code>
With Worksheets("Employees")
LastRow = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H2:H" & LastRow).Name = "rng_EmpSelection"
End With
Load uf_Emp
uf_Emp.cbx_EmpSelect.RowSource = "rng_EmpSelection"
uf_Emp.cbx_EmpSelect.ListRows = LastRow
uf_Emp.Show
</code>