macro to sum with offset in 2 cell as other cell changed

I

irealtymods

I need to create macro with this scenario:
F - quantity
H - 1 serial
I - 2 serial
For example some cells:

H644 =SUM(I643+1)
I644 =SUM(I643+F644)
So when I put some number in cell F644, sums correctly calculated,
then one by one cell as i enter some in F

Thank you.
 
I

irealtymods

is this macro correct for this operation?


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("F:F")) Is Nothing Then
With Target
If .Value <> "" Then
..Offset(0, 2).Value = Cells(Target.Row - 1, 9) + 1
..Offset(0, 3).Value = Cells(Target.Row - 1, 9) + Cells(Target.Row, 6)
..Offset(0, 6).Value = Format(Now, "yymmdd")
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top