Hej JTH,
Prøv med denne stump.
Jeg har farvet de steder jeg har ændret.
Sub Update_Row_Colors()
Dim LRow As Integer
Dim LCell, MCell, NCell As String
Dim LColorCells, MColorCells, NColorCells, OColorCells, PColorCells As String
LRow = 7 'Starter i række 7
While LRow < 400 'opdatere i 400 rækker
LCell = "b" & LRow
MCell = "b" & LRow
NCell = "c" & LRow
' Områder der bliver farvet
LColorCells = "b" & LRow & ":" & "w" & LRow
MColorCells = "y" & LRow & ":" & "am" & LRow
NColorCells = "b" & LRow & ":" & "c" & LRow
OColorCells = "a" & LRow
PColorCells = "i6:w6"
Select Case Left(Range(LCell).Value, 2)
Case "05"
Range(LColorCells).Interior.Color = RGB(231, 230, 230)
End Select
Select Case Left(Range(MCell).Value, 2)
Case "04"
Range(MColorCells).Interior.Color = RGB(208, 206, 206)
Range(MColorCells).Borders.LineStyle = xlContinuous
Range(MColorCells).FormulaLocal = Range(PColorCells).FormulaLocal
Case "05"
Range(MColorCells).Interior.Color = RGB(231, 230, 230)
Range(MColorCells).Borders.LineStyle = xlContinuous
Range(MColorCells).NumberFormatLocal = "#.##0,00_);[Rød](#.##0,00);[Farve15]#.##0,00_)"
End Select
Select Case Left(Range(NCell).Value, 1)
Case "L"
Range(NColorCells).Interior.Color = RGB(217, 225, 242)
Case "S"
Range(NColorCells).Interior.Color = RGB(217, 225, 242)
End Select
Select Case Left(Range(NCell).Value, 1)
Case "M"
Range(OColorCells).Interior.Color = RGB(217, 225, 242)
End Select
LRow = LRow + 1
Wend
End Sub