maksinx
02-15-2007, 02:06 PM
hello everyone;
i have below code for auto calculation and i would like to apply same code to entire column.
basicly what i want to is whatever value i write on a2 it should add up to the value on b2 and ,a3 to b3, a4 to b4, a5 to b5,
a1 heading is = last stock quantity
b1 heading is = total stock quantity
and also i would like to use the same logic (code) for stock deduction
lets say i write wtosk value on a2 and deduct that figure from the value of b2.
any help is highly appreciated.
thanks in advance
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
ActiveSheet.Range("B2") = ActiveSheet.Range("B2") + ActiveSheet.Range("A2")
Application.EnableEvents = True
End Sub
i have below code for auto calculation and i would like to apply same code to entire column.
basicly what i want to is whatever value i write on a2 it should add up to the value on b2 and ,a3 to b3, a4 to b4, a5 to b5,
a1 heading is = last stock quantity
b1 heading is = total stock quantity
and also i would like to use the same logic (code) for stock deduction
lets say i write wtosk value on a2 and deduct that figure from the value of b2.
any help is highly appreciated.
thanks in advance
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
ActiveSheet.Range("B2") = ActiveSheet.Range("B2") + ActiveSheet.Range("A2")
Application.EnableEvents = True
End Sub