chriscorpion786
Board Regular
- Joined
- Apr 3, 2011
- Messages
- 108
- Office Version
- 365
- Platform
- Windows
Hi All,
I would like to color the cell if the user makes a selection and once the user selects another cell, the previous cell color changes back to the normal color as before.
I am trying the below code, but its not working.
Much appreciated..
I would like to color the cell if the user makes a selection and once the user selects another cell, the previous cell color changes back to the normal color as before.
I am trying the below code, but its not working.
Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B48:B57")) Is Nothing Then
Target.Interior.Color = vbGreen
Else
If Intersect(Target, Range("B48: B57")) Is Nothing Then
With Range("B48: B57").Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
End If
End If
End Sub
Much appreciated..
Last edited by a moderator: