4thorns
Structural
- Jan 22, 2009
- 152
I'm trying to tweak the following script to apply only to 1 cell.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("h1").Interior.ColorIndex = xlNone Then
With Range("h1").Interior
.ColorIndex = 43
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
With Range("h1").Interior
.ColorIndex = x1None
End With
End If
End Sub
At this point when I click (h1) it changes to green but as soon as I click a different cell (H1) changes back to no color. Any thoughts?
Doug
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("h1").Interior.ColorIndex = xlNone Then
With Range("h1").Interior
.ColorIndex = 43
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
With Range("h1").Interior
.ColorIndex = x1None
End With
End If
End Sub
At this point when I click (h1) it changes to green but as soon as I click a different cell (H1) changes back to no color. Any thoughts?
Doug