15.02.2019, 10:41
Moin
ich habe dei Aufgabe durch eure Hilfe so gelöst
es ging einfach nur um eine Logik, nach der mir nach Eingabe in bestimmte Zellen, bestimmte andere Zellen angezeigt werden, damit man nicht den Zeilen "verrutscht".
Danke
P.S. Da es immer mehrere Lösungen für Herausforderungen/ Probleme gibt, sollte man nicht böse sein, wenn "seine" Lösung nicht gewählt wird ;)
ich habe dei Aufgabe durch eure Hilfe so gelöst
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$21" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$D$21" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$E$21" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$F$21" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$G$21" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$H$21" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$C$28" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$D$28" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$E$28" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$F$28" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$G$28" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$H$28" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$C$35" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$D$35" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$E$35" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$F$35" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$G$35" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$H$35" Then
Range("D13:K13").Interior.Color = vbYellow
ElseIf Target.Address = "$C$20" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$D$20" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$E$20" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$F$20" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$G$20" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$H$20" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$C$27" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$D$27" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$E$27" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$F$27" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$G$27" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$H$27" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$C$34" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$D$34" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$E$34" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$F$34" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$G$34" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$H$34" Then
Range("D12:K12").Interior.Color = vbRed
ElseIf Target.Address = "$C$19" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$D$19" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$E$19" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$F$19" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$G$19" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$H$19" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$C$26" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$D$26" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$E$26" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$F$26" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$G$26" Then
Range("D12:K12").Interior.Color = vbCyan
ElseIf Target.Address = "$H$26" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$C$33" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$D$33" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$E$33" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$F$33" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$G$33" Then
Range("D11:K11").Interior.Color = vbCyan
ElseIf Target.Address = "$H$33" Then
Range("D11:K11").Interior.Color = vbCyan
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngBereich As Range
Set rngBereich = Range("D11:K13")
If Not Intersect(Target, rngBereich) Is Nothing Then
rngBereich.Interior.Color = xlNone
End If
End Sub
es ging einfach nur um eine Logik, nach der mir nach Eingabe in bestimmte Zellen, bestimmte andere Zellen angezeigt werden, damit man nicht den Zeilen "verrutscht".
Danke
P.S. Da es immer mehrere Lösungen für Herausforderungen/ Probleme gibt, sollte man nicht böse sein, wenn "seine" Lösung nicht gewählt wird ;)