Hallo,
bin mehr oder weniger blutiger Amateur in Excel Vba und weiß nicht mehr weiter.
In meiner Tabelle stehen in Spalte 1 Hersteller und in Spalte 2 die Produkte. über eine UserForm mit zwei Comboboxen versuche ich nun, Hersteller und ein dazugehörendes Produkt anzuzeigen.
Option Explicit
Dim cell1 As Variant
Dim cell2 As Range
Dim cell3 As Variant
Dim cell4 As Variant
Private Sub UserForm_Initialize()
Sheets("Tabelle2").Select
For Each cell1 In Range("A2:A7")
If Not cell1.Text = "" Then
ComboBox1.AddItem cell1.Text
End If
Next
End Sub
Private Sub ComboBox1_Change()
Sheets("Tabelle2").Select
Set cell2 = ActiveSheet.Cells.Find(what:=ComboBox1.Value)
If Not cell2 Is Nothing Then cell3 = cell2.Offset(, 1).Address
Range(cell3).Select
cell4 = ActiveCell.Offset(3, 0).Adress
'ComboBox2.List = Range(cell3) & (cell3.Offset(3, 0).Address)
ComboBox2.RowSource = (cell3) & (cell4)
End Sub
Bei cell4 = ...
bekomme ich Laufzeitfehler 438
Die Zeile ComboBox2.List funzt auch nicht
Vielen Dank im voraus
Gangerl_61
|