set the background color of the current cell(active cell)

K

kang

how to set the background color the row of the current cell(active cell)
each time I click the cells.
 
G

Guest

Hi,

Right click the sheet tab, view code and paste this in.

Public OldRange As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not OldRange Is Nothing Then
OldRange.Interior.ColorIndex = xlNone
End If
Target.Interior.ColorIndex = 36
Set OldRange = Target
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top