AW: Auswahl über Userform
05.02.2015 16:32:26
Christian
hallo Norbert,
so zB:
Option Explicit
Private Sub CommandButton1_Click()
Dim cntr As Control
Dim strRes As String
For Each cntr In Me.Controls
If TypeName(cntr) = "ComboBox" Then
If cntr.Value "" Then
strRes = strRes & cntr.Value & ", "
End If
End If
Next
If Len(strRes) Then
strRes = Left(strRes, Len(strRes) - 2)
If InStr(strRes, ",") Then
strRes = Left(strRes, InStrRev(strRes, ",") - 1) & " und" & _
Right(strRes, Len(strRes) - InStrRev(strRes, ","))
End If
End If
ThisWorkbook.Sheets("Tabelle1").Cells(1, 1) = "Angezeigt: " & strRes
Unload Me
End Sub
Private Sub UserForm_Activate()
Dim vntNames As Variant
Dim i As Long
vntNames = Array("Hans", "Petra", "Franz", "Michi", "Simone")
For i = 1 To 5
Me.Controls("ComboBox" & i).List = vntNames
Next
End Sub
kommst du damit klar?
Gruß
Christian