ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combo box control source (https://www.excelbanter.com/excel-programming/424977-combo-box-control-source.html)

paula

combo box control source
 
I need to use a named range for the control source for a combo box in a
userform. is that possible, and if so, how!

thanks!
--
paulao

Dave Peterson

combo box control source
 
Option Explicit
Private Sub UserForm_Initialize()
With Me.ComboBox1
.ControlSource = ActiveWorkbook.Worksheets("sheet9999") _
.Range("somenamedrangehere").Address(external:=Tru e)
End With
End Sub

Adjust the sheetname and range name to what you need.

paula wrote:

I need to use a named range for the control source for a combo box in a
userform. is that possible, and if so, how!

thanks!
--
paulao


--

Dave Peterson

Nigel[_2_]

combo box control source
 
ComboBox1.RowSource = "MyRangeName"

or if named range is sheet specific

ComboBox1.RowSource = "Sheet1!MyRangeName"



--

Regards,
Nigel




"paula" wrote in message
...
I need to use a named range for the control source for a combo box in a
userform. is that possible, and if so, how!

thanks!
--
paulao



Nigel[_2_]

combo box control source
 
Oops! sorry misread row for control - but maybe that is what you want?

--

Regards,
Nigel




"Nigel" wrote in message
...
ComboBox1.RowSource = "MyRangeName"

or if named range is sheet specific

ComboBox1.RowSource = "Sheet1!MyRangeName"



--

Regards,
Nigel




"paula" wrote in message
...
I need to use a named range for the control source for a combo box in a
userform. is that possible, and if so, how!

thanks!
--
paulao





All times are GMT +1. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com