Now you will do EXACTLY the same thing in the original file
I assume that cells Z1, Z2 and Z3 are not being used
(Z3 will be used in the next step)
In the original file ...
1. delete all previous code - both module code and sheet code
2. In cell Z1 in the relevant sheet enter this formula
=A1
3. Right-click on sheet tab \ view code \ insert code below
VBA Code:
Private Sub Worksheet_Calculate()
Debug.Print "Triggered " & Time
Call MacroY(Me)
End Sub
Sub MacroY(sh As Worksheet)
sh.Range("Z2") = WorksheetFunction.Max(sh.Range("A1"), sh.Range("Z2"))
End Sub
4. Test by manually amending the value in A1 twice - the value in Z1 and Z2 will change
5. Ensure that cell A1 is being updated by the internet
- Z1 should change when A1 changes
- Z2 should change when new value in A1> current value in Z2
You can also confirm that internet updates are triggering the code by checking the immediate window which will look like this
Triggered 11:58:18
Triggered 11:59:19
Triggered 12:00:19
6. When this is working correctly - let me know
7. Do you want to use cells Z1, Z2 Z3 or different cells? - let me know which cells