Hello i have created this code to create a chart, my plan is to have a button with a macro attached so that a user could create charts. But im wondering if there is a way so they can create more than one chart, because if you click the button once it creates a chart, but if you click it again it just over writes the old one, instead of creating a new chart. Thank you
Code:
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range("A1:B3")
Worksheets("Sheet2").Range("A2") = "Compliant"
Worksheets("Sheet2").Range("a3") = "Non Compliant"
Z = InputBox("What is the title of the Chart")
Worksheets("Sheet2").Range("b1") = Z
x = InputBox("How many compliant")
Worksheets("Sheet2").Range("B2") = x
y = InputBox("How many non compliant")
Worksheets("Sheet2").Range("b3") = y