Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 10
Default Using offset in series values of a chart

I have 1 named range created with the offset function on sheet(1):

Month=offset($A$1,0,0,counta($A:$A),1)

Simple to use as the x-as categories in a chart.

For the y-axis I want to use data which can be offset 1, 2, up to 20 columns.
Yes I can create 20 named ranges but to do that for 20 sheets in my workbook
gets cumbersome.
Therefor my question:
Can I use the offset function in the series values, like:
=offset(Month,0,7)

In VBA it it can be done with:
..SeriesCollection(2).Values = Month.Offset(0, 17)
But then I have to create one macro for each graph...again cumbersome.

Please help.

Thx.
Beertje.
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Using offset in series values of a chart

You have to create one named range for each set of Y values.

For your charts, if you are making it with VBA, just accept the selected
range from the user, use the first column as the X values, and use each
subsequent column for each series.

' air code
Dim rData As Range
Dim iCol As Long
Dim iChart As Chart
Set rData = Selection
Set oChart = ActiveSheet.ChartObjects.Add(100, 100, 350, 275).Chart
Do While oChart.SeriesCollection.Count 0
oChart.SeriesCollection(1).Delete
Loop
For iCol = 1 To rData.Columns.Count - 1
With oChart.SeriesCollection.NewSeries
.Values = rData.Columns(iCol + 1)
.XValues = rData.Columns(1)
End With
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Beertje" wrote in message
...
I have 1 named range created with the offset function on sheet(1):

Month=offset($A$1,0,0,counta($A:$A),1)

Simple to use as the x-as categories in a chart.

For the y-axis I want to use data which can be offset 1, 2, up to 20
columns.
Yes I can create 20 named ranges but to do that for 20 sheets in my
workbook
gets cumbersome.
Therefor my question:
Can I use the offset function in the series values, like:
=offset(Month,0,7)

In VBA it it can be done with:
.SeriesCollection(2).Values = Month.Offset(0, 17)
But then I have to create one macro for each graph...again cumbersome.

Please help.

Thx.
Beertje.



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
chart x-axis values appear as a series rm5417 Charts and Charting in Excel 1 July 26th 07 03:43 PM
Read series values range of a chart matelot Charts and Charting in Excel 2 May 15th 07 03:45 AM
Bubbble chart -How to automatically add series names, X, Y values RHI Charts and Charting in Excel 1 November 16th 05 10:20 PM
Chart -- How to chart 65536 values in 1 series? kilmaley11 About this forum 0 June 8th 05 11:19 AM
Create new series (on the same chart) for every change of values in a combobox uriel78 Charts and Charting in Excel 5 April 15th 05 12:08 AM


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