ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combobox population question (https://www.excelbanter.com/excel-programming/400534-combobox-population-question.html)

Mekinnik

combobox population question
 
I am trying to populate multible comboboxes from different sheets and cannot
figure out how to do it with the from initialize event. Heres my code. Please
help.

Private Sub UserForm_Initialize()
CbxMfg.List = Worksheets("MANCODE").Range("A2:A1000").Value
CboFire.List = Worksheets("Lists").Range("D2:D5").Value
CboHealth.List = Worksheets("Lists").Range("D2:D5").Value
CboReact.List = Worksheets("Lists").Range("D2:D5").Value
CboDisp.List = Worksheets("Lists").Range("E2:E4").Value
CboDept.List = Worksheets("Lists").Range("C2:C10").Value
End Sub

OssieMac

combobox population question
 
Hi,

Following examples should help. (Edit for your ranges).

CbxMfg.RowSource = Worksheets("MANCODE") _
.Range("A1:A26").Address(external:=True)

CboFire.RowSource = Worksheets("Lists") _
.Range("B1:B26").Address(external:=True)

Regards,

OssieMac

"Mekinnik" wrote:

I am trying to populate multible comboboxes from different sheets and cannot
figure out how to do it with the from initialize event. Heres my code. Please
help.

Private Sub UserForm_Initialize()
CbxMfg.List = Worksheets("MANCODE").Range("A2:A1000").Value
CboFire.List = Worksheets("Lists").Range("D2:D5").Value
CboHealth.List = Worksheets("Lists").Range("D2:D5").Value
CboReact.List = Worksheets("Lists").Range("D2:D5").Value
CboDisp.List = Worksheets("Lists").Range("E2:E4").Value
CboDept.List = Worksheets("Lists").Range("C2:C10").Value
End Sub



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

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