lunes, 26 de noviembre de 2018

EXCEL RESALTAR FILA

ELEGIR SELECTIOCHANGE


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Static nFila As Integer

Dim RangoActual As Range
Dim strFilas As Integer
Dim strColumnas As Integer

Set RangoActual = ActiveSheet.Range("A7").CurrentRegion
strFilas = RangoActual.Rows.Count
strColumnas = RangoActual.Columns.Count

If nFila <> Empty Then
   
    Cells(nFila, 1).Resize(1, strColumnas).Interior.ColorIndex = xlNone

End If

If ActiveCell.Row > 7 And ActiveCell.Row <= strFilas + 6 And ActiveCell.Column <= strColumnas Then
   
    nFila = ActiveCell.Row
   
    Cells(ActiveCell.Row, 1).Resize(1, strColumnas).Interior.ColorIndex = 6
    ActiveCell.Interior.ColorIndex = 43
   
End If
   
End Sub