VBA Fill a comboBox with ActiveCell

December 2016

VBA Fill a comboBox with ActiveCell


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.


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


Solved by Paf

Related :

This document entitled « VBA Fill a comboBox with ActiveCell » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.