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: 1
Default how to create chart by VBA coding?


Hi all,

I recorded a macro to add a chart, and altered the code shown as
follows:

Sub newChart()
charts.Add
ActiveChart.Location Whe=xlLocationAsObject, Name:="User
Preferences"
With ActiveChart
..SetSourceData Source:=Sheets("User
Preferences").Range("A12").CurrentRegion, PlotBy:=xlColumns
..HasTitle = True
..ChartType = xlColumnClustered
..ChartTitle.Characters.Text = "Interactive Chart Analysis"
..Axes(xlCategory, xlPrimary).HasTitle = True
..Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Countries"
..Axes(xlValue, xlPrimary).HasTitle = True
..Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Rating"
End With
End Sub

however, while 'Call newChart', error message shows method 'Add' is not
found.

i've checked books and online information, but still couldn't solve it.
can anyone help please? :(

Thanks
Fendic


--
Fendic
------------------------------------------------------------------------
Fendic's Profile: http://www.excelforum.com/member.php...o&userid=23959
View this thread: http://www.excelforum.com/showthread...hreadid=380441

 
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
create line chart with two axises in Pivot Chart HuaXC Charts and Charting in Excel 1 February 21st 07 08:28 PM
Chart data file lost - need to re-create from chart? LostExcelData Charts and Charting in Excel 1 June 7th 06 07:54 PM
How to see the chart coding? ramkumar_cpt Charts and Charting in Excel 1 March 10th 06 12:12 PM
Need help with data from coding....try to create an update button marty6[_10_] Excel Programming 2 May 4th 04 06:19 PM
Excel Chart Event Coding ramkee27 Excel Programming 0 February 20th 04 02:59 PM


All times are GMT +1. The time now is 11:26 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"