Refresh Active Sheet

50 Views Asked by At

I am reading data from a database via excel power query. I would like to create a refresh button so I dont have to continue to go to the data tab then select refresh or refresh all. There are times I want to only refresh a worksheet and other times workbook.

The code is driven off a single cell value that is manually entered. I have to refresh for two reasons. First, to pull in the data from multiple tables in the data base. Second, as changes are being made, I need to update the worksheet based on the changes being made to the data as we are using the worksheet to view the data.

I have tried a slew of simple codes to accomplish this but it will not work.

Private Sub refreshSheet_Click()
    ActiveSheet.RefreshAll
End Sub
0

There are 0 best solutions below