Home ยป excel ยป Populate ComboBox with Row values in Excel VBA

Populate ComboBox with Row values in Excel VBA

Posted by: admin April 23, 2020 Leave a comment

Questions:

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 ๐Ÿ™‚

How to&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