Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a lot of objets in a sheet (for example combobox).
I have to load each combobox with the same datas. How can I use a loop to do that ? I tought to put the comboboxes in a collection but I don't know the syntaxe. Can I use : For each element in collection Do ...... Next Thanks for answering to a VBA excel beginner. Michel MORICE |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For combobox from the control toolbox toolbar
Dim oleObj as OleObject for each oleObj in Activesheet.OleObjects then if typeof oleObj.Object is MSForms.ComboBox then oleObj.ListFillRange = "Sheet1!A1:A10" end if Next from the forms toolbar dim cbox as DropDown for each cbox in Activesheet.DropDowns cbox.ListfillRange = "sheet1!A1:A10" Next -- Regards, Tom Ogilvy mor.mic wrote in message ... I have a lot of objets in a sheet (for example combobox). I have to load each combobox with the same datas. How can I use a loop to do that ? I tought to put the comboboxes in a collection but I don't know the syntaxe. Can I use : For each element in collection Do ...... Next Thanks for answering to a VBA excel beginner. Michel MORICE |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
You answered exactly to my question. "Tom Ogilvy" a écrit dans le message news: ... For combobox from the control toolbox toolbar Dim oleObj as OleObject for each oleObj in Activesheet.OleObjects then if typeof oleObj.Object is MSForms.ComboBox then oleObj.ListFillRange = "Sheet1!A1:A10" end if Next from the forms toolbar dim cbox as DropDown for each cbox in Activesheet.DropDowns cbox.ListfillRange = "sheet1!A1:A10" Next -- Regards, Tom Ogilvy mor.mic wrote in message ... I have a lot of objets in a sheet (for example combobox). I have to load each combobox with the same datas. How can I use a loop to do that ? I tought to put the comboboxes in a collection but I don't know the syntaxe. Can I use : For each element in collection Do ...... Next Thanks for answering to a VBA excel beginner. Michel MORICE |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I use and indexed value as the name of an array for vlooku | Excel Worksheet Functions | |||
how to link excel worksheets with a reference (indexed) key field. | Excel Worksheet Functions | |||
How do I create and indexed field | Excel Discussion (Misc queries) | |||
excel how do I calculate income indexed each year for 15 years | Excel Discussion (Misc queries) | |||
indexed line chart? | Charts and Charting in Excel |