Problem:
In einen Formular(Userform) habe ich eine Combobox, welche mir Werte aus der Tabelle Grafik anzeigt. Im Combofeld wird dann ein bestimmter Wert rausgezogen. In den darunter liegenden Textfelder sollen dann Datumswerten zum Wert aus einer anderen Tabelle Planung rauszieht.
Mein Code bis jetzt. Zudem sind in einen paar Zeilen keine Werte vorhanden, daher mein Versuch mit SpecialCells.
Fehlermeldung:
Eigenschaft Value konnte nicht gesetzt werden.Typenkonflikt
Private Sub ComboBox1_Change()
Me.TextBoxMSN = Me.ComboBox1.Column(0)
'Sverweis aus Tabelle Planung
'CF-1
Me.TextCF_1.Value = WorksheetFunction.VLookup([F2:F32], Sheets("Planung").[B1:V32], 5, _
False)
On Error Resume Next
[F2:F32].SpecialCells(xlCellTypeConstants, 16).ClearContents
'CF-2
Me.TextCF_2.Value = WorksheetFunction.VLookup([J2:J32], Sheets("Planung").[B1:V32], 9, _
False)
On Error Resume Next
[J2:F32].SpecialCells(xlCellTypeConstants, 16).ClearContents
'CF-3
Me.TextCF_3.Value = WorksheetFunction.VLookup([N2:N32], Sheets("Planung").[B1:V32], 13, _
False)
On Error Resume Next
[N2:N32].SpecialCells(xlCellTypeConstants, 16).ClearContents
'CF-4
Me.Text_CF4.Value = WorksheetFunction.VLookup([R2:R32], Sheets("Planung").[B1:V32], 17, _
False)
On Error Resume Next
[R2:F32].SpecialCells(xlCellTypeConstants, 16).ClearContents
'CF-5
Me.Text_CF5.Value = WorksheetFunction.VLookup([V2:V32], Sheets("Planung").[B1:V32], 21, _
False)
On Error Resume Next
[V2:V32].SpecialCells(xlCellTypeConstants, 16).ClearContents
End Sub
Private Sub UserForm_Initialize()
ComboBox1.RowSource = "Grafik!B7:B34"
End Sub
Vielen Dank für eure MüheViele Grüße
Christian