Fill Active Row and Column in Excel
1. First press Arlt+F11
2. Double Click on Sheet Name
3. Copy the following code and paste it. Then save and enjoy it.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
' Clear the color of all the cells
Cells.Interior.ColorIndex = 0
With Target
' Highlight the entire row and column that contain the active cell
.EntireRow.Interior.ColorIndex = 37
.EntireColumn.Interior.ColorIndex = 37
.EntireColumn.Font.Color = vbRed
End With
Application.ScreenUpdating = True
End Sub
0 Comments