I have a worksheet event macro that fires when a hyperlink formula is clicked - it "highlights" (changes the cell interior color) the hyperlink destination cell so it is more visible to the end user. How do I change the destination cell to be "unhighlighted" (i.e. change the cell interior color back to white) when the user no longer needs it? i.e. i have turned the highligher "on", how do i turn it "off"? code below turns highlight "on":
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ControlPoint As String
Dim RowVar As Integer
Dim Destination As String
If InStr(1, Target.Cells(1, 1).Formula, "HYPERLINK") = 0 Then Exit Sub
ControlPoint = Target.Value
RowVar = Application.WorksheetFunction _
.Match(ControlPoint, _
Sheets("Control Point Log").Range("c1:c700"), 0)
Destination = "C" & RowVar
Sheets("Control Point Log").Range(Destination).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
End Sub
Bookmarks