I am importing an Access database into an Excel workbook. I want to filter the table I am importing automatically based on the value of a cell in the Excel worksheet. I have been able to do that through Power Query code.
Next step is updating the table I am importing every time the cell value changes. I have been able to update the query every time any cell in the whole sheet (the one where the key cell is) changes using this code in VBA:
Private Sub Worksheet_Change(ByVal Target As Range)
ThisWorkbook.RefreshAll
End Sub
I would like to edit that VBA code so that the Power query only updates when the particular cell that I am using to filter the table changes, not when any cell in the sheet changes.
Appreciate any tips!