Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Unlink chart from sheet

How can I replace ranges in a chart's SERIES formula with their current
values? I know how to do this in Excel, but how would I do this in VBA? Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Unlink chart from sheet

If you know how to do it in Excel, have you tried recording a macro to see
what the VBA would look like to do the same thing? That would be my first
step.

HTH,

Eric


"Gerry Verschuuren" wrote:

How can I replace ranges in a chart's SERIES formula with their current
values? I know how to do this in Excel, but how would I do this in VBA? Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Unlink chart from sheet

You can store your chart data as arrays in the relevant sections of the
series formula, providing each section has no more than an absolute maximum
of 255 characters. Eg this array of three values has 14 characters

{1.23,2,3.456}

Programmatically it might be as simple as doing this -

Sub test()
Dim cht As Chart
Dim sr As Series
Set cht = ActiveChart
For Each sr In cht.SeriesCollection
sr.Name = sr.Name ' if linked to cell
sr.Values = sr.Values
sr.XValues = sr.XValues ' only do if the formula includes x-values
Next
End Sub

Of course you might also need to do similar with titles. There's a different
approach if the each set of data will amount to more than 255, see thread in
this ng starting 13-May-2010, subject
".Seriescolection(n).formula - size limitation?"

Regards,
Peter T


"Gerry Verschuuren" wrote in
message ...
How can I replace ranges in a chart's SERIES formula with their current
values? I know how to do this in Excel, but how would I do this in VBA?
Thanks



Reply
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
Unlink a chart in Excel/Powerpoint 2007 TimB Charts and Charting in Excel 1 September 13th 08 07:01 PM
Want to unlink calculations Otto Moehrbach[_2_] Excel Worksheet Functions 0 July 9th 08 09:12 PM
Want to unlink calculations electricbluelady Excel Worksheet Functions 3 June 26th 08 01:38 PM
Unlink a file ?? Kane New Users to Excel 3 February 5th 06 08:01 PM
Unlink graphics in VBA Jan Excel Programming 2 October 22nd 04 11:59 AM


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