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 delink all charts in worksheet

I've used a macro written by Tushar Mehta to delink charts in my
worksheet.

I need to delink all worksheets and have tried adding some code to
activate the charts one at a time. It seemed to work fine one time,
but it's now giving me problems. Here is the code. Help me out if
you can.

TIA

Gerry

Sub DeLinkCharts()
''' Thanks to Tushar Mehta

Dim ChartNm As String
Dim ChtObj As ChartObject
Dim mySeries As Series
Dim sChtName As String

''' Make sure a chart is selected

For Each ChtObj In ActiveSheet.ChartObjects
ChartNm = ChtObj.Name
ActiveSheet.ChartObjects(ChartNm).Activate
ActiveChart.ChartArea.Select

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(ChartNm).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
Next
Range("A1").Select
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
Multiple Bar Charts from 1 Worksheet Jeffrey Marks Charts and Charting in Excel 0 July 4th 11 10:40 PM
Can you tile 8 charts on a worksheet? WA Charts and Charting in Excel 1 November 11th 09 05:21 PM
How do I place two or more charts on a worksheet? Rick@Draper Charts and Charting in Excel 3 August 1st 07 04:56 PM
Delete ALL Charts in a WorkSheet (VB) Corey Charts and Charting in Excel 2 October 4th 06 08:41 AM
List Charts in a Worksheet Phil Hageman[_3_] Excel Programming 2 May 17th 04 04:41 PM


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