AW: Combobox, userform
29.07.2006 11:01:35
Wolfgang
Hallo K.Rola,
ich habe Dein Makro versucht an zu passen bekomme aber die Fehlermeldung T4 Variable nicht definiert.
Kannst Du mir dabei noch mal helfen.
das Makro sieht jetzt folgendermaßen aus:
Initialize habe ich eingefügt
Private Sub ComboBox62_Change()
If ComboBox62.Tag = "" Then
If ComboBox62.ListIndex = -1 And _
Len(ComboBox62) > 0 And _
Left(ComboBox62, 1) <> Chr(32) Then
CommandButton9.Enabled = True
Else
CommandButton9.Enabled = False
End If
End If
End Sub
Private Sub CommandButton9_Click()
T4.Cells(lz + 1, 1) = ComboBox62
fill_it
CommandButton9.Enabled = False
End Sub
'
Private Sub UserForm_Initialize()
'CommandButton9.Enabled = False
'fill_it
'End Sub
Sub fill_it()
Dim z As Long
With ComboBox62
.Tag = "x"
For z = 1 To lz
.AddItem T4.Cells(z, 1)
Next
.ListIndex = 0
.Tag = ""
.SelStart = 0
.SelLength = Len(ComboBox62)
.SetFocus
End With
End Sub
Function lz() As Long
Dim rc As Long
rc = T4.Rows.Count
lz = IIf(T4.Cells(rc, 12) "", rc, T4.Cells(rc, 12).End(-4162).Row)
End Function
Gruß Wolfgang