Microsoft Excel

Herbers Excel/VBA-Archiv

Informationen und Beispiele zum Thema CommandButton
BildScreenshot zu CommandButton CommandButton-Seite mit Beispielarbeitsmappe aufrufen

Combo Box List creation

Betrifft: Combo Box List creation von: Marc
Geschrieben am: 05.11.2014 19:02:47

Hello,

I would like to chose from the Combo Box some list items in column A. Once I hit the Add button, those should be lined up under D. So I chose A first and it will go to D1. Than I chose B and it will go to D2.

Thanks,

Marc

https://www.herber.de/bbs/user/93579.xlsx

  

Betrifft: AW: Combo Box List creation von: Uduuh
Geschrieben am: 05.11.2014 19:17:06

Hello,
sorry for my mistake of yesterday. This does what you want:

Private Sub CommandButton1_Click()
  Dim lRow As Long
  lRow = Cells(Rows.Count, 4).End(xlUp).Row
  If Cells(lRow, 4) <> "" Then lRow = lRow + 1
  Cells(lRow, 4) = ComboBox1
End Sub
Gruß
Rudi


  

Betrifft: AW: Combo Box List creation von: Marc
Geschrieben am: 05.11.2014 20:15:29

Thank you. Great!

Marc