AW: Workaround
28.02.2018 15:40:21
Christian
Hallo Chris,
leider ohne Erfolg. Jetzt wird das Change-Ereignis zwar ausgelöst, aber die Schriftfarbe ändert sich nicht in schwarz. Hier der komplette Code für die Combobox4:
Private Sub Combobox4_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As _
Single, ByVal y As Single)
UserForm5.ComboBox4.ForeColor = vbBlack
Call Produkt
UserForm6.Hide
End Sub
Private Sub Produkt()
If UserForm5.CheckBox1.Value = False Then
UserForm5.Label4.ForeColor = vbBlack
UserForm5.Label4.BackColor = &H80000004
UserForm5.Label4 = ""
Else
UserForm5.Label4.BackColor = vbWhite
UserForm5.Label4 = "Bitte geben Sie auch bei der Auswahl eines Produktes in Fremdwährung _
die weiteren Rechenvariablen, wie das 'Volumen' und/oder 'Sonstige Provisionen', in der Währung 'EUR' ein."
End If
End Sub
Private Sub Combobox4_Change()
UserForm5.ComboBox4.ForeColor = vbBlack
If UserForm5.ComboBox4.Value "" Then
UserForm5.TextBox11 = ""
UserForm5.TextBox12 = ""
UserForm5.TextBox13 = ""
UserForm5.TextBox4 = WorksheetFunction.VLookup(UserForm5.ComboBox4.Value, Worksheets("Dropdowns _
Pipeline").Range("O3:ZZ1000"), 18, False)
Else
UserForm5.TextBox4 = ""
End If
If Len(UserForm5.ComboBox4) = 0 Then
UserForm5.TextBox5.BackColor = vbWhite
UserForm5.TextBox6.BackColor = vbWhite
UserForm5.TextBox7.BackColor = vbWhite
UserForm5.TextBox8.BackColor = vbWhite
UserForm5.TextBox9.BackColor = vbWhite
UserForm5.TextBox10.BackColor = vbWhite
UserForm5.TextBox6 = ""
UserForm5.TextBox6 = ""
UserForm5.TextBox7 = ""
UserForm5.TextBox8 = ""
UserForm5.TextBox9 = ""
UserForm5.TextBox10 = ""
End If
UserForm5.CommandButton6.Caption = "Berechnen"
UserForm5.CommandButton7.Enabled = False
Call Produktvariablen
End Sub