Karlbirger
Board Regular
- Joined
- Sep 21, 2011
- Messages
- 68
Hi guys,
I have written the below code (thank You Andrew for this) but when I try to select a whole row (A:AM) when any cell in column A6:A & LastRow2 equals "Finished" there is a run-time error.
If the requirement is fulfilled, the column A:AM on that specific row shall change colour.
I dont know if this is a correct code to use, but I think so. I get a run-time error on the below red marked code. I have put the code in Worksheet_SelectionChange.
Using Vista2007 and Excel2007.
Regards
KB
I have written the below code (thank You Andrew for this) but when I try to select a whole row (A:AM) when any cell in column A6:A & LastRow2 equals "Finished" there is a run-time error.
If the requirement is fulfilled, the column A:AM on that specific row shall change colour.
I dont know if this is a correct code to use, but I think so. I get a run-time error on the below red marked code. I have put the code in Worksheet_SelectionChange.
Code:
Dim LastRow2 As Long
Dim Cell2 As Range
LastRow2 = Range("A" & Rows.Count).End(xlUp).Row
For Each Cell2 In Range("A6:A" & LastRow2)
If Cell2.Value = "Finished" Then
[B][COLOR=red]Range("A:AM" & Cell2.Row).Select[/COLOR][/B]
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Else
End If
Next Cell2
Using Vista2007 and Excel2007.
Regards
KB