Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I am trying to specify a chart type from a userform. The chart is selected by the user in the active sheet and then the macro is run. It tries to change the chart type to the one selected from the combobox. When I hardcode the charttype in the macro it works. However when I try to get value from the combobox text it doesnt. What is wrong? I'm putting the code below for your reference : Private Sub CommandButton2_Click() On Error Resume Next Dim ct As Integer Dim chrttype As String ct = ComboBox1.Value chrttype = Trim(ListBox1.Value) 'MsgBox chrttype 'On Error Resume Next If ct = 0 Then MsgBox "Please select a series value from the list to continue..." Exit Sub Else ActiveChart.SeriesCollection(ct).Select ActiveChart.SeriesCollection(ct).ChartType = chrttype ActiveChart.SeriesCollection(ct).Select End If CommandButton2.Visible = False ListBox1.Visible = False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting rows using CRTL, Shift and down or up arrows not working | Excel Discussion (Misc queries) | |||
ChartType inconsistent on various LanguagePacks | Excel Programming | |||
How do I offer ChartType options? | Charts and Charting in Excel | |||
Two charttype on chart | Charts and Charting in Excel | |||
Argument List Of ActiveChart.Location And ActiveChart.ChartType | Excel Programming |