I found a lot of answers to my question following this link: automatically execute an Excel macro on a cell change
The reason I'm opening a new question is because I don't have enough reputation to comment on that thread and I'm having difficulty connecting my linked cell to the macro I want to run.
So the cells that are linked contains a formula causing it to change value only when I change other cells. The problem I'm having is that my macro only runs if I change the value of the cell and not the value of the formula. I'm looking for a way to activate the macro when the value that the formula returns changes.
This is my code so far:
My range of cells is named "Values" and I want to hide the label "Refresh"
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("Values")) Is Nothing Then Exit Sub
Application.EnableEvents = False 'to prevent endless loop
Sheet1.Refresh.Visible = False
Application.EnableEvents = True
End Sub
Sorry again for opening another question but as I said I couldn't comment on the other thread.
value of the formula
what does that mean? – findwindowchange the value of the cell and not the value of the formula
– findwindow