AW: Hintergrundfarbe austauschen
10.09.2010 14:53:44
Ramses
Hallo
hier mal ein grundsätzlicher Ansatz bei dem die zu ersetzende Farbe der zelle ebenfalls bereits in RGB definiert ist
Sub change_col()
Dim chkArea As Range, chkC As Range
Dim col1 As Long, col2 As Long, col3 As Long
Dim col1n As Long, col2n As Long, col3n As Long
Dim col11 As Long, col22 As Long, col33 As Long
Dim col11n As Long, col22n As Long, col33n As Long
'1. Farbe
'Alte Farbe RGB
col1 = 0 'Rot
col2 = 0 'Gelb
col3 = 0 'Grün
'Neue Farbe RGB
col1n = 100 'Rot
col2n = 100 'Gelb
col3n = 100 'Grün
'2 Farbe
col11 = 0 'Rot
col22 = 0 'Gelb
col33 = 0 'Grün
'Neue Farbe RGB
col11n = 100 'Rot
col22n = 100 'Gelb
col33n = 100 'Grün
Set chkArea = Range("A1:Z1000")
For Each chkC In chkArea
With chkC
If .Interior.Color = RGB(col1, col2, col3) Then
.Interior.Color = RGB(col1n, col2n, col3n)
End If
If .Interior.Color = RGB(col11, col22, col33) Then
.Interior.Color = RGB(col11n, col22n, col33n)
End If
End With
Next
End Sub
Das ganze könntest du in eine Schleife packen und deine "800 Seiten" durchlaufen lassen
Gruss Rainer