Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Populate ComboBox with Row values in Excel VBA

I am not able to populate a combobox with cell values stores in a single row, horizontally. It works when they are placed vertically, though.

ComboBox.List ("A1:A10") works but ComboBox.List("A1:J1") doesn't. It only displays the first value in the latter case.

I would be grateful if someone could help me out. Thanks :)

like image 554
Rakshith Shetty Avatar asked Jan 19 '26 18:01

Rakshith Shetty


1 Answers

Transpose your array:

 ComboBox1.List = Application.Transpose(Sheet1.Range("A1:J1").Value)

p.s.: the correct syntax from a column is:

ComboBox1.List = Sheet1.Range("A1:A10").Value
like image 192
A.S.H Avatar answered Jan 22 '26 07:01

A.S.H