W0RKAH0LIC
Technical User
How do you modify the background color of an active cell? I want the clicked cell to stand out more than the background.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
ActiveCell.Interior.ColorIndex = 3
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
End Sub
Option Explicit
Dim LastCell As String
Dim LastColor As Integer
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Cells.Count = 1 Then
'MsgBox Target.Interior.ColorIndex
If LastCell <> "" Then
Range(LastCell).Interior.ColorIndex = LastColor
End If
LastCell = ActiveCell.Address
LastColor = ActiveCell.Interior.ColorIndex
ActiveCell.Interior.ColorIndex = 3
End If
End Sub