Hello
I have nearly the perfect macro for my job, but I need one little change. The thing I is that my macro should color the row within the search conditions is and the two rows below. At this moment it only colors the row with the search result.
Heres my macro:
Sub Farv_weekend()
Dim LRow As Integer
Dim LCell As String
Dim LColorCells As String
'Start at row 4
LRow = 4
'Update row colors for the first 150 rows
While LRow < 150
LCell = "A" & LRow
'Color will changed in columns A to G
LColorCells = "A" & LRow & ":" & "G" & LRow
Select Case Left(Range(LCell).Value, 6)
'Set row color to light blue
Case "Lørdag"
Range(LColorCells).Interior.ColorIndex = 15
Range(LColorCells).Interior.Pattern = xlSolid
'Set row color to light green
Case "Søndag"
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = 15
Range(LColorCells).Interior.Pattern = xlSolid
'Default all other rows to no color
Case Else
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = xlNone
End Select
LRow = LRow + 1
Wend
Range("A1").Select
End Sub
Looking forward to get some help
Anders
Denmark
Bookmarks