Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - Read the series' chart data ranges

Consider a line graph with two Y axis:

I can create a graph, and I can change its data range


name_plan = "sheet1" ' sheet name
name_col = InputBox("Row the columns' given name", , 1)
col_y1 = InputBox("Primary column number", , 2)
col_y2 = InputBox("Secondary column number", , 3)
start_col = InputBox("Row the columns start", , 2)
end_col = InputBox("Row the columns end", , 25)

'Defining the data range

' Range to Y1 axis
start_cel1 = "R" & start_col & "C" & col_y1
end_cel1 = "R" & end_col & "C" & col_y1
name_cel1 = "R" & name_col & "C" & col_y1

' Range to Y2 axis
start_cel2 = "R" & start_col & "C" & col_y2
end_cel2 = "R" & end_col & "C" & col_y2
name_cel2 = "R" & name_col & "C" & col_y2

' Range to X1 and X2 axis
event_col = 1 ' 'This collum goes to X axis
start_axis1 = "R" & start_col & "C" & event_col
end_axis1 = "R" & end_col & "C" & event_col
start_axis2 = start_axis1
end_axis2 = end_axis1

'Defining the SeriesCollections
ActiveChart.SeriesCollection(1).Values = "=" & name_plan & "!"
start_cel1 & ":" & end_cel1
ActiveChart.SeriesCollection(2).Values = "=" & name_plan & "!"
start_cel2 & ":" & end_cel2
ActiveChart.SeriesCollection(1).Name = "=" & name_plan & "!"
name_cel1
ActiveChart.SeriesCollection(2).Name = "=" & name_plan & "!"
name_cel2
ActiveChart.SeriesCollection(1).XValues = "=" & name_plan & "!"
start_axis1 & ":" & end_axis1
ActiveChart.SeriesCollection(2).XValues = "=" & name_plan & "!"
start_axis2 & ":" & end_axis2



It fulfill my needs, but I don't know how to read th
ActiveChart.SeriesCollection().Ranges, in some how I will supply thi
information to procedure or even print it with Msgbox.

For exemple, image I have the "sheet2" with equal data disposition, bu
"sheet2" is related to another period, and I have a plent of graph
related to "sheet1", therefore I just change all the ranges wit
"sheet1" to "sheet2"

--
Message posted from http://www.ExcelForum.com

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
Line Chart with multiple series that have different date ranges Rach7110 Charts and Charting in Excel 2 April 26th 23 03:46 AM
Copying Named Ranges in Chart Series Revolvr Charts and Charting in Excel 1 March 18th 10 12:21 PM
How to divide a data series into different ranges? Arun Charts and Charting in Excel 2 January 14th 08 06:31 AM
Read series values range of a chart matelot Charts and Charting in Excel 2 May 15th 07 03:45 AM
chart data series -- plot a table as a single series hjc Charts and Charting in Excel 7 September 20th 05 05:52 PM


All times are GMT +1. The time now is 10:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"