ich möchte nur die Zellenfarbe der Spalte B nach Eingabe einer Zahl
ändern und zwar in Rot.
Die Farbe ist vorher Blau.
mfg Kurt B
Private Sub Worksheet_Change(ByVal Target As Range)
''If Target.Count > 1 Then Exit Sub
''If Not Intersect(Target, Range("G:G")) Is Nothing Or _
'' Not Intersect(Target, Range("AA:AA")) Is Nothing Then
''On Error GoTo ErrHandler
''Application.EnableEvents = False
'' With Target
'Wenn - an 2.Stelle:
'' If Mid(.Text, 2, 1) = "-" Then
'' .Value = Application.WorksheetFunction.Substitute(Application.WorksheetFunction. _
Substitute(Target, "-", ""), " ", "")
'' .NumberFormat = "0 ""-"" 000 00000"
'Wenn Eingabe mit 06 beginnt:
' ElseIf Left(.Text, 2) = "06" Then
' ElseIf Left(.Text, 2) = "06" Or Left(.Text, 1) = "6" Then
'' ElseIf Left(.Text, 2) = "00" Or Left(.Text, 1) >= "0" Then
'' .Value = Application.WorksheetFunction.Substitute(Target, " ", "")
'' .NumberFormat = "00 000 00000" 'so stand es
'' End If
'' End With
''End If
''ErrHandler:
''Application.EnableEvents = True
''End Sub
werde gleich mal versuchen, etwas anzupassen,B | |
4 | |
5 | da ist was drin |
6 | |
7 | |
8 | |
9 | auch hier |
10 | |
11 |
bedingte Formatierung | |||||||||
Zelle | Typ | Operator | Formel1 | Formel2 | Format | Unterstrichen | Schrift- farbe | Muster | Muster- farbe |
B4 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B5 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B6 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B7 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B8 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B9 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B10 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 | |||||
B11 | 1.Bed.: Zellwert ist | ungleich | ="" | 255 |
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("AQ:AQ")) Is Nothing Or _
Not Intersect(Target, Range("AU:AU")) Is Nothing Then
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
.Value = Application.WorksheetFunction.Substitute(Application.WorksheetFunction. _
Substitute(Target, "-", ""), " ", "")
.NumberFormat = "#,##0.00"
.Font.ColorIndex = 3 ' 11=blau 3=rot
.Font.Bold = True ' fett
End With
End If
ErrHandler:
Application.EnableEvents = True
End Sub
es ist so wie ich es haben wollte, jetzt werde ich dies in meiner Orginaltabelle einsetzen.