我想知道如何访问组合框的值。我尝试了几种语法可能性,但无法在线找到解决方案。将来我需要两个组合框的值来向表中添加新行。
Sub add_termin()
Dim lastrow As Long
Dim typ As String
Dim frist As Date
Dim tops As String
ThisWorkbook.Activate
Set diesesworkbook = ActiveWorkbook
lastrow = diesesworkbook.Sheets("Termine").Range("A" & Rows.Count).End(xlUp).Row
typ = ComboBox1.Column(1).Value
MsgBox (lastrow)
'Hinzufügen neuer Zeile
'diesesworkbook.Sheets("Termine").Range("A" & (lastrow + 1)).Value = ComboBox1.Value
'diesesworkbook.Sheets("Termine").Range("B" & (lastrow + 1)).Value = TestBox1.Value
'diesesworkbook.Sheets("Termine").Range("C" & (lastrow + 1)).Value = ComboBox2.Value
编辑:
我找到的解决方案是在ComboBox前面添加UserForm
typ = Termineingabe.ComboBox1.Value
1条答案
按热度按时间iaqfqrcu1#
这只是一个如何获取所选索引的列值的示例