LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Automatically create a chart

Hi,

It does not like it because it contains multiple areas.
The will construct a reference from the areas. Note there is a limit to
the length of the series formula so lots of area may cause another error
to occur.

'---------------
Dim rngTemp As Range
Dim strAddress As String

For Each rngTemp In Range("C11,C13,C15").Areas
strAddress = strAddress & _
"'" & rngTemp.Parent.Name & "'!" & _
rngTemp.Address(, , xlR1C1) & ","
Next
strAddress = "=(" & Left(strAddress, Len(strAddress) - 1) & ")"

ActiveChart.SeriesCollection(1).Values = strAddress
'---------------

Cheers
Andy

YH wrote:
I am in the process of automating a chart creation and get stuck on this line:

'WS is declared as a worksheet
ActiveChart.SeriesCollection(1).values = WS.Range("G34, I34, K34, M34, O34")

I want to create a series in a chart by selecting multiple noncontinguous
cells, but
I run into errors executing this line.

Can someone point out what is wrong?

Thanks,

YH


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
 
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
How to automatically create a thumbnail of a published chart/image [email protected] Charts and Charting in Excel 0 August 25th 06 08:39 AM
Chart data file lost - need to re-create from chart? LostExcelData Charts and Charting in Excel 1 June 7th 06 07:54 PM
able to automatically create a chart in Excel tamccann Charts and Charting in Excel 2 November 3rd 05 04:13 AM
Macro to Create a Chart and Update it Automatically maperalia Charts and Charting in Excel 2 October 21st 05 05:42 PM


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