ich möchte erreichen dass wenn eine Eintrag von cbo14 bis cbo52 gleich ist mit cbo1 bis cbo13, dann soll der Eintrag rot werden.
z.B.: wenn text von cbo44 gleich ist wie text von cbo2, dann cbo2 soll rot markiert werden.
Bei folgende Code werden alle Einträge von cbo1 bis cbo13 rot, aber dass will ich nicht:
Sub Farben()
For b = 1 To 13
x = 0
For c = 14 To 52
If ActiveSheet.OLEObjects("ComboBox" & CStr(b)).Object.Text = ActiveSheet.OLEObjects("ComboBox" & CStr(c)).Object.Text Then
x = x + 1
End If
Next
If x = 0 Then
ActiveSheet.OLEObjects("ComboBox" & CStr(b)).Object.ForeColor = 0
Else
ActiveSheet.OLEObjects("ComboBox" & CStr(b)).Object.ForeColor = vbRed
End If
Next
End
Sub
Danke
Fabiano