I am using Excel 2010 and I want that the Excel sheet will be updated (calculated) automatically when the value of a cell (Range("B7")
) is changed (The Range("B7")
is a drop-down list). I am trying to use the intersect-target method like:
Private Sub Worksheet_Change(ByVal target As Range)
If Not Intersect(target, Range("B7")) Is Nothing Then
ActiveSheet.Calculate
End If
End Sub
I have two questions about this:
Does it matter if I put this Private Sub under any module? Or am I supposed to write it in the exact sheet under the Microsoft Excel -object menu in VBA?
The second question is how I can make this work? The sheet doesn't update (calculate) automatically when I change the Range("B7")
. It only updates when I save the Excel file.