VBA Fill a comboBox with ActiveCell

VBA Fill a comboBox with ActiveCell

Issue

I have a little problem with Excel VBA.

I'd like to display text in a ComboBox proposals through the function ActiveCell. I put this code but it crashes at the 3rd line:

Feuil5.Range ("A6"). ComboBox2.AddItem Activate Do (Worksheets ("Table MRP). ActiveCell.Value) ActiveCell.Offset (3, 0). Activate Loop Until ActiveCell.Text =" "

This code should allow me to fill my ComboBox proposals with the values in cells A6, A9, A12 ...until there is an empty cell.

Thank you in advance for your help.

Solution

I could not get out of error messages, the following solution works

i = 6 Do While Worksheets ("Table MRP). Cells (i, 1) <>" "ComboBox2. AddItem (Worksheets (" Table MRP). Cells (i, 1). Value) i = i + 3 Loop

Note

Solved by Paf

Spread the love

Leave a Comment