Dear all,
I am trying to write a code and would very much appreciate your help.
Where I am trying to get is - when in the range A2:B11 a cell is changed (user has changed the value), then macro will recalculate that specific line.
Unfortunately, I cannot figure out correct code, so if you have any suggestions, please share those.
My best attempt so far:
___________________________________________________________
Private Sub Worksheet_Change(ByVal Target As Range)
Dim a As Integer, cols As Range, cell As Range
Set cols = Range("C2:D11")
For Each cell In cols
If Intersect(Target, cell) Is Nothing Then Exit Sub
Application.EnableEvents = False 'to prevent endless loop
Worksheets("Sheet3").Rows(cell.Row & ":" & cell.Row).Calculate
Application.EnableEvents = True
Next cell
End Sub
___________________________________________________________
Bookmarks