Repetí macro ya creada...

hola amigos, tengo la siguiente macro:

Private Sub Worksheet_Change(ByVal Target As Range)
'Por.DAM
If Not Intersect(Target, Range("E:E")) Is Nothing Then
If Cells(Target.Row, "D") < 0 Then
Application.EnableEvents = False
Cells(Target.Row, "C") = Cells(Target.Row, "C") + Cells(Target.Row, "D")
Cells(Target.Row, "D") = Cells(Target.Row, "D") * -1
If Cells(Target.Row, "E") > 90 Then
Cells(Target.Row, "E") = Cells(Target.Row, "E") - 90
Else
Cells(Target.Row, "E") = Cells(Target.Row, "E") + 90
End If
Application.EnableEvents = True
End If
End If
End Sub

la cual se ejecuta en las columnas C, D, E y necesito que también se ejecute en las columnas H, I, J, como lo consigo, salu2

Respuesta
1

Private Sub Worksheet_Change(ByVal Target As Range)
'Por.Pirataibero
If Not Intersect(Target, Range("J:J")) Is Nothing Then Application.EnableEvents = False

If Cells(Target.Row, "D") < 0 Then
Cells(Target.Row, "C") = Cells(Target.Row, "C") + Cells(Target.Row, "D")
Cells(Target.Row, "D") = Cells(Target.Row, "D") * -1
If Cells(Target.Row, "E") > 90 Then
Cells(Target.Row, "E") = Cells(Target.Row, "E") - 90
Else
Cells(Target.Row, "E") = Cells(Target.Row, "E") + 90
End If

End If

If Cells(Target.Row, "I") < 0 Then
Cells(Target.Row, "H") = Cells(Target.Row, "H") + Cells(Target.Row, "I")
Cells(Target.Row, "I") = Cells(Target.Row, "I") * -1
If Cells(Target.Row, "J") > 90 Then
Cells(Target.Row, "J") = Cells(Target.Row, "J") - 90
Else
Cells(Target.Row, "J") = Cells(Target.Row, "J") + 90
End If

End If

Application.EnableEvents = True
End If

End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas