Hello, I hope someone can help me because I seem to be screwing up more than I should be.
I have made an excel sheet which shows or hides a graphs based on the value of a cell
if: "deze maand" then show graph 1 and hide graph 2.
if: "Dit jaar" then show graph 1 and 2.
In order to make this work automatically, I have also made a macro that changes a cell fill colour when either cell values are correct.
This because excel seems to need an action in order to update the changes.
The problem is that now that on any other cell changes, the Both macro runs. Deleting its history and making it impossible to use the "Undo" button.
Is there any way I can adjust this code, so it first checks if there are any changes in cell a3, before executing the underlying steps.
This so that the undo button is still in function and the cell fill action is only executed when the correct cell value changes (through a drop-down menu)
_____________________________________________________________________________________________________________________________
#
_____________________________________________________________________________________________________________Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("T6").Value = "Deze maand" Then Sheets("Overview").ChartObjects("Grafiek1").Visible = True Sheets("Overview").ChartObjects("Grafiek2").Visible = False ElseIf Range("T6").Value = "Dit jaar" Then Sheets("Overview").ChartObjects("Grafiek1").Visible = True Sheets("Overview").ChartObjects("Grafiek2").Visible = True End If End Sub Sub worksheet_change(ByVal Target As Range) Set Target = Range("T6") If Target.Value = "Deze maand" Then Call DezeMaand End If If Target.Value = "Dit jaar" Then Call DitJaar End If End Sub
I really hope someone could help with this, it's the last step of the process before I can send it out :-(
Thanks in advanced!
Bookmarks