Excel/VBA - Populate ComboBox with Values
Solved
RussellD
Posted messages
60
Status
Membre
-
RussellD Posted messages 60 Status Membre -
RussellD Posted messages 60 Status Membre -
Hello everyone,
On my Excel 2003 sheet, I have a ComboBox (created via Design mode, not a dropdown list created by Data/Validation). I would like that when I open my Excel sheet, it "loads" with the values from a range of cells (for example, range (Q1:Q4)).
I can't seem to do this; I tried (in VBA):
but it doesn't work.. I tried removing the "", removing the .Value, I messed with this syntax without being able to achieve my goal. Following a suggestion on another forum, I tried this:
But it doesn't work; it gives me the error "Object Required". Does anyone have an idea to solve this problem?
Thank you in advance for your responses,
Best regards
On my Excel 2003 sheet, I have a ComboBox (created via Design mode, not a dropdown list created by Data/Validation). I would like that when I open my Excel sheet, it "loads" with the values from a range of cells (for example, range (Q1:Q4)).
I can't seem to do this; I tried (in VBA):
Private Sub WorkBook_Open() ComboBox1.RowSource = Sheets("Feuil1").Range("Q1:Q4").Value End sub but it doesn't work.. I tried removing the "", removing the .Value, I messed with this syntax without being able to achieve my goal. Following a suggestion on another forum, I tried this:
Private Sub WorkBook_Open() ComboBox1.List = Sheets("Déperditions").Range("Q1:Q4").Value End Sub But it doesn't work; it gives me the error "Object Required". Does anyone have an idea to solve this problem?
Thank you in advance for your responses,
Best regards
This is not working, the values are not even listed in the combo box anymore.. What is the BeforeDropAndPaste event exactly?