gitmeto
Board Regular
- Joined
- Nov 24, 2021
- Messages
- 60
I have a sheet that contains a table generated by a repeating scan of a directory to detect when specific files are modified. On another sheet (Sheet("Linked")) I have a cell that is linked via a formula (=cellmodified) to the "Date Modified" value in the table generated by Power Query (PQ).
What I am attempting to do is run a macro on Sheet("Linked") when the cell value change on this sheet. Below you will find the code that I thought would trigger the macro but to no avail. Any assistance would be greatly appreciated!
What I am attempting to do is run a macro on Sheet("Linked") when the cell value change on this sheet. Below you will find the code that I thought would trigger the macro but to no avail. Any assistance would be greatly appreciated!
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Me.Range("C6").Address _
Then
' Turn off Excel functionality to improve performance.
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
'Refresh the table
ListObjects("table2").QueryTable.Refresh BackgroundQuery:=False
'Restore Automatic Calucalation to run calculator
Application.Calculation = xlCalculationAutomatic
Call daily_calculate
' Turn off Excel functionality to improve performance.
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.EnableEvents = True
End If
End Sub