LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Selecting charttype from macro is not working

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting rows using CRTL, Shift and down or up arrows not working Gilbert Excel Discussion (Misc queries) 4 November 4th 08 02:51 PM
ChartType inconsistent on various LanguagePacks Morten poulsem Excel Programming 0 February 20th 06 02:31 PM
How do I offer ChartType options? davidm Charts and Charting in Excel 4 December 29th 05 02:13 PM
Two charttype on chart shah firdaous via OfficeKB.com Charts and Charting in Excel 1 April 16th 05 05:28 PM
Argument List Of ActiveChart.Location And ActiveChart.ChartType Mo[_3_] Excel Programming 2 September 1st 03 11:12 PM


All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"