![]() |
Displaying XValues.
I tried
MsgBox myChart.SeriesCollection(1).XValues MsgBox myChart.SeriesCollection(1).XValues.Address MsgBox myChart.SeriesCollection(1).XValues.Value They don't work. Here the of code: Sub Macro4_2() Dim rArea As Range, rXValues As Range, rYValues As Range Dim c As Variant Dim i As Integer Dim iNseries As Integer Dim chtmyChart As Chart Dim sSTR As String Set rArea = Application.InputBox(prompt:="Select range:", Type:=8) Set rXValues = Application.InputBox(prompt:="Select XValues:", Type:=8) Set rYValues = Application.InputBox(prompt:="Select YValues:", Type:=8) iNseries = rArea.Rows.Count - 1 Set chtmyChart = Charts.Add With chtmyChart For i = 1 To iNseries .SeriesCollection.NewSeries Next .Name = "Pippo" i = 1 For Each c In .SeriesCollection sSTR = "=Foglio1!" & rArea.Offset(i - 1, 0).Resize(1, rArea.Columns.Count).Address(ReferenceStyle:=xlR1C 1) Rem c.Values = "=Foglio1!$C$4:$L$4" Rem c.Values = sSTR c.Name = "=Foglio1!" & rYValues(i - 1).Address(ReferenceStyle:=xlR1C1) c.XValues = rXValues.Address i = i + 1 Rem MsgBox "LABEL: " & sYValues(i).Address & "SERIE: " & sSTR & "" Next .ChartType = xlSurface End With all things go fine << MsgBox chtmyChart.SeriesCollection(1).XValues macro stops << End Sub |
Displaying XValues.
From John Walkenbach's site:
http://j-walk.com/ss/excel/tips/tip83.htm A Class Module to Manipulate a Chart SERIES -- Regards, Tom Ogilvy "y" wrote in message ... I tried MsgBox myChart.SeriesCollection(1).XValues MsgBox myChart.SeriesCollection(1).XValues.Address MsgBox myChart.SeriesCollection(1).XValues.Value They don't work. Here the of code: Sub Macro4_2() Dim rArea As Range, rXValues As Range, rYValues As Range Dim c As Variant Dim i As Integer Dim iNseries As Integer Dim chtmyChart As Chart Dim sSTR As String Set rArea = Application.InputBox(prompt:="Select range:", Type:=8) Set rXValues = Application.InputBox(prompt:="Select XValues:", Type:=8) Set rYValues = Application.InputBox(prompt:="Select YValues:", Type:=8) iNseries = rArea.Rows.Count - 1 Set chtmyChart = Charts.Add With chtmyChart For i = 1 To iNseries .SeriesCollection.NewSeries Next .Name = "Pippo" i = 1 For Each c In .SeriesCollection sSTR = "=Foglio1!" & rArea.Offset(i - 1, 0).Resize(1, rArea.Columns.Count).Address(ReferenceStyle:=xlR1C 1) Rem c.Values = "=Foglio1!$C$4:$L$4" Rem c.Values = sSTR c.Name = "=Foglio1!" & rYValues(i - 1).Address(ReferenceStyle:=xlR1C1) c.XValues = rXValues.Address i = i + 1 Rem MsgBox "LABEL: " & sYValues(i).Address & "SERIE: " & sSTR & "" Next .ChartType = xlSurface End With all things go fine << MsgBox chtmyChart.SeriesCollection(1).XValues macro stops << End Sub |
All times are GMT +1. The time now is 12:09 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com