Combobox Rowsource with Dynamic Named Ranges VBA Excel

Hello Experts,

Please kindly Guide me that i can Combox2 in which i want add items with Change in Combox1 i have Dynamic Name ranges using Offser Through Formula Name Manager Range1,Range2,Range3,Range4 all Ranges have Multiple Rows to Add i have too add all ranges items  in combox2 so i made code

userform1.combobox2.rowsource = "Range1" Its Working but when i want to Put Multiple named ranges like this userform1.combobox2.rowsource = "Range1","Range2","Range3","Range4" Please guide me is it possible to load items from multiple named ranges if possible then kindly advice solution.

if not then what is alternate solution.

WiseOwl ExcelFinance ExxcutiveAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ejgil HedegaardCommented:
Rowsource can only use a single column.

You can do something like this, if the ranges are the same size.
Option Explicit

Private Sub UserForm_Initialize()
    Dim cl As Range, i As Integer
    Me.ComboBox1.ColumnCount = 3
    Me.ComboBox1.ColumnWidths = "20,20,20"
    For Each cl In [Range1]
        Me.ComboBox1.AddItem cl.Text
    Next cl
    i = 0
    For Each cl In [Range2]
        Me.ComboBox1.Column(1, i) = cl.Text
        i = i + 1
    Next cl
    i = 0
    For Each cl In [Range3]
        Me.ComboBox1.Column(2, i) = cl.Text
        i = i + 1
    Next cl
End Sub

Open in new window

NorieAnalyst Assistant Commented:
Is the combobox multicolumn and you want to populate each column from one of the named ranges?

Or is it single column and you want to populate it with values from all the named ranges one above the other?
WiseOwl ExcelFinance ExxcutiveAuthor Commented:

I want to Populate in Single Column From My Named Ranges and Not My Name Ranges have onliy one Column.

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

NorieAnalyst Assistant Commented:
You wouldn't be able to do that using RowSource, you would have to use AddItem or List.
Dim rng As Range
Dim ar As Range
Dim cl As Range

    Set rng = Range("Range1, Range2, Range3")
    For Each ar In rng.Areas
        For Each cl In ar.Cells
            ComboBox1.AddItem cl.Value
        Next cl
    Next ar

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WiseOwl ExcelFinance ExxcutiveAuthor Commented:
rng = Range("Range1, Range2, Range3")

Syntex Error How Ever i have done it with with.

Thanks for Your Kind Input.

Rob HensonFinance AnalystCommented:
It is also possible with Data Validation.

Take a look at this article: Dynamic Data Vaildation

Any queries from that, please comment on the article.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.