Formato condicional con vba excel
Tengo el siguiente código, lo que quiero es que si en la fila tiene datos aplica el formato y si no que no haga nada.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim valor As String
Dim mesano As String
If Intersect(Target, Range("I:I")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
valor = Target.Value
mesano = Sheets("INDICE").Range("J4") & Chr(32) & Sheets("INDICE").Range("L4")
If IsNumeric(valor) Then
Range(Cells(Target.Row, "B"), Cells(Target.Row, "L")).Interior.Color = RGB(153, 255, 153)
Range("A" & Target.Row).ClearContents
Range("K" & Target.Row).Value = mesano
ElseIf valor = "PEDIDO" Then
Range(Cells(Target.Row, "B"), Cells(Target.Row, "L")).Interior.Color = RGB(184, 204, 228)
Else
Range(Cells(Target.Row, "B"), Cells(Target.Row, "L")).Interior.ColorIndex = xlNone
Range("K" & Target.Row).ClearContents
End If
Application.EnableEvents = True
End Sub
1 Respuesta
Respuesta de Dante Amor
1