VBA Fill a comboBox with ActiveCell

April 2018

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
Published by aakai1056. Latest update on December 25, 2010 at 05:01 AM by aakai1056.
This document, titled "VBA Fill a comboBox with ActiveCell," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).
Java - File Transfer Client-Server
Gamemaker - The programming language used