Hello everyone, I'm currently trying to find a code that would allow me to make a simple operation than works in two ways. I found an old thread from 2011 that answered the question, but I would like to apply the formula to a range of cells and not just the 3 shown in here.
The code is:
Although I would not use this very same formula, the concept is exactly the same, but I need to apply it to a certain range within a column, B2:B33, D2:D33 and F2:F33 to be precise.
I'm new to VBA and I tried everything within my knowledge but I just can't seem to pull this off.
Thanks in avadvance.
The code is:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address(0, 0) = "B2" Then [D2] = Target - [F2]
If Target.Address(0, 0) = "D2" Then [B2] = Target + [F2]
Application.EnableEvents = True
End Sub
Although I would not use this very same formula, the concept is exactly the same, but I need to apply it to a certain range within a column, B2:B33, D2:D33 and F2:F33 to be precise.
I'm new to VBA and I tried everything within my knowledge but I just can't seem to pull this off.
Thanks in avadvance.
Last edited by a moderator: