ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do you isolate a graph from it's data? (https://www.excelbanter.com/excel-discussion-misc-queries/107900-how-do-you-isolate-graph-its-data.html)

mizterbusy

How do you isolate a graph from it's data?
 
Hi everyone,

I have a very large file with lots of data and one sheet full of
graphs.

I need to distribute the graphs but not the data and what I've been
doing is right-clicking the sheet with graphs and selecting

move or copy THEN
create new book THEN
new book

to create a book with the one sheet of graphs. I've then emailed this
sheet out.

My problem now is that when I try this technique, my graphs all get
distorted for some reason.

Can anyone advise me what the best way to do this is - ie. how do you
best quarantine graphs from their data simply and easily, without
distorting the graphs?

Any help would be much appreciated.

Thanks all.


Carim

How do you isolate a graph from it's data?
 
Hi,

Following macro does the job ...

Sub DelinkChartFromData()
''' Thanks to Tushar Mehta
Dim mySeries As Series
Dim sChtName As String

''' Make sure a chart is selected
On Error Resume Next
sChtName = ActiveChart.Name
If Err.Number < 0 Then
MsgBox "This functionality is available only for charts " _
& "or chart objects"
Exit Sub
End If
If TypeName(Selection) = "ChartObject" Then
ActiveSheet.ChartObjects(Selection.Name).Activate
End If
On Error GoTo 0

''' Loop through all series in active chart
For Each mySeries In ActiveChart.SeriesCollection
'''' Convert X and Y Values to arrays of values
mySeries.XValues = mySeries.XValues
mySeries.Values = mySeries.Values
mySeries.Name = mySeries.Name
Next mySeries
End Sub


HTH
Cheers
Carim


Andy Pope

How do you isolate a graph from it's data?
 
Hi,

Have a look at the options on Jon's page
http://peltiertech.com/Excel/ChartsH...ChartData.html

You may well find though that the VBA Delink routine will not work if
you have a large amount of data in each chart.

Cheers
Andy

mizterbusy wrote:
Hi everyone,

I have a very large file with lots of data and one sheet full of
graphs.

I need to distribute the graphs but not the data and what I've been
doing is right-clicking the sheet with graphs and selecting

move or copy THEN
create new book THEN
new book

to create a book with the one sheet of graphs. I've then emailed this
sheet out.

My problem now is that when I try this technique, my graphs all get
distorted for some reason.

Can anyone advise me what the best way to do this is - ie. how do you
best quarantine graphs from their data simply and easily, without
distorting the graphs?

Any help would be much appreciated.

Thanks all.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com