Excel VBA cor linhas colunas acompanha cursor
Excel VBA Planilhas, cursor acompanha linha e coluna com cores, linha de vermelho e colunas e outra amarelo, e também a célula ativa na cor laranja. Vamos fazer 2 maneiras fazer que levam ao mesmo resultado.

‘///================’
Private Sub Worksheet_SelectionChange(ByVal t As Excel.Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Cells.Font.ColorIndex = 1
Cells.Font.Bold = False
Cells.Font.Size = 9
Cells.Borders.LineStyle = xlNone
Cells.Borders.ColorIndex = xlNone
Range(Cells(t.Row, “b”), Cells(t.Row, “m”)).EntireRow.Interior.ColorIndex = 3
Range(Cells(t.Row, t.Column), Cells(t.Row, t.Column)).EntireColumn.Interior.ColorIndex = 36
Range(Cells(t.Row, t.Column), Cells(t.Row, t.Column)).Borders.LineStyle = xlContinuous
Range(Cells(t.Row, t.Column), Cells(1, t.Column)).Borders.ColorIndex = 5
t.Interior.ColorIndex = 4
t.Font.ColorIndex = 9
t.Font.Bold = True
End Sub
‘///=============’
‘outro exemplo
Private Sub Worksheet_SelectionChange(ByVal t As Excel.Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Range(Cells(t.Row, “b”), Cells(1, “m”)).EntireRow.Interior.ColorIndex = 3
Range(Cells(t.Row, t.Column), Cells(t.Row, t.Column)).EntireColumn.Interior.ColorIndex = 36
t.Interior.ColorIndex = 4
End Sub
‘//===========
Escola SaberExcel VBA Estudos
http://www.saberexcel.com.br –. contato@saberexcel.com.br