Hi, I am new to VBA, I currently have a drop down list and when you select a value, the macro that corresponds to that value runs. The point of this is to display a different chart when you select a value. However, when you select a new value, the previous macro that ran doesn't disappear so the charts overlap which is pointless. How can I tell excel that it needs to clear the previous chart/macro before displaying the next? Any help would be appreciated! To be clear all I did for my macro was copy an existing chart and paste it into another sheet. Maybe there is a better way than that? Here is my code:
Option Explicit
Sub DropDown2_Change()
With ThisWorkbook.Sheets("Dynamic Charts").Shapes("Drop Down 2").ControlFormat
Select Case .List(.Value)
Case "1": FirstChart
Case "2": SecondChart
Case "3": ThirdChart
Case "4": FourthChart
Case "5": FifthChart
Case "6": SixthChart
Case "7": SeventhChart
Case "8": EighthChart
Case "9": NinthChart
Case "10": TenChart
Case "11": ElevenChart
Case "12": TwelveChart
Case "13": ThirteenChart
Case "14": FourteenChart
Case "15": FifteenChart
Case "16": SixteenChart
End Select
End With
End Sub
Bookmarks