ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,736
- Office Version
- 2007
- Platform
- Windows
Evening,
I am using the code below but need to apply a slight change to it if you could advise please.
Currently the code does not function on column 4 which is fine BUT i also wish it now not to work on column 4 and 7
I am using the code below but need to apply a slight change to it if you could advise please.
Currently the code does not function on column 4 which is fine BUT i also wish it now not to work on column 4 and 7
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.ScreenUpdating = False
Dim lastrow As Long
lastrow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If Intersect(Target, Range("A8:I" & lastrow)) Is Nothing Then Exit Sub
If Target.Column <> 4 Then
Range("A8:C" & lastrow).Interior.ColorIndex = 6
Range("E8:F" & lastrow).Interior.ColorIndex = 6
Range("H8:I" & lastrow).Interior.ColorIndex = 6
Target.Interior.ColorIndex = 8
End If
Application.ScreenUpdating = True
End Sub