boa noite!!
Oi maninhx, veja se isso te ajuda
Abra o Edito VBA, Alt + F11, do lado esquerdo Plan1 (Plan1), cole o código, e faça os testes
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Columns("B:B")) Is Nothing Then Exit Sub
If Not IsNumeric(Target.Value) Then Exit Sub
Application.EnableEvents = False
If (Target.Row Mod 2) = 0 Then
Select Case Target - Target.Offset(-1, 0)
Case Is = 0
Target.Offset(-1, -1) = 0
Case Is > 0
Target.Offset(-1, -1).Value = Target.Value - Target.Offset(-1, 0).Value
Target.Offset(-1, 0).Value = Target.Value
Case Is < 0
Target.Offset(-1, -1).Value = Target.Value - Target.Offset(-1, 0).Value
Target.Value = Target.Offset(-1, 0).Value
End Select
End If
Application.EnableEvents = True
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 24/04/2012 6:10 pm