chapster21
12-09-2008, 07:49 PM
I have attached the program that I am working on. I need to add a userform that lets the user choose between two different types of charts that they want displayed for each button choice. I have tried the below code but it does not work.
Option Explicit
Public choice As Chart
Private Sub CommandButton1_Click()
With choice
Charts.Add
If OptionButton1 Then
ActiveChart.ChartType = xlColumnClustered
Else: ActiveChart.ChartType = xlConeCol
End If
End With
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Option Explicit
Public choice As Chart
Private Sub CommandButton1_Click()
With choice
Charts.Add
If OptionButton1 Then
ActiveChart.ChartType = xlColumnClustered
Else: ActiveChart.ChartType = xlConeCol
End If
End With
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub