Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
gvm gvm is offline
external usenet poster
 
Posts: 38
Default range variables for chart x axis values

Another question related to my recent post. Some search hits come close to a
solution but don't quite hit the spot. I am altering recorded macros. The
line I want to change is:
ActiveChart.SeriesCollection(1).XValues = "='Traffic model'!R14C7:R32C7"

I want to change !R14C7:R32C7 to a form where each row and column number is
a variable.
TIA again ... Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default range variables for chart x axis values

Just compose the string in the format you've already got, using the &
operator to piece together the various components, along the lines of:
ActiveChart.SeriesCollection(1).XValues = "='Traffic model'!R" & StartRow &
"C" & StartCol & ":R" & EndRow & "C" & EndCol

"gvm" wrote:

Another question related to my recent post. Some search hits come close to a
solution but don't quite hit the spot. I am altering recorded macros. The
line I want to change is:
ActiveChart.SeriesCollection(1).XValues = "='Traffic model'!R14C7:R32C7"

I want to change !R14C7:R32C7 to a form where each row and column number is
a variable.
TIA again ... Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default range variables for chart x axis values

If you have the range defined already, you can also use this:

ActiveChart.SeriesCollection(1).XValues =
Worksheets("Sheet1").Range("D11:D15")

or this, if rXValues is a VBA range variable:

ActiveChart.SeriesCollection(1).XValues = rXValues

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


"bpeltzer" wrote in message
...
Just compose the string in the format you've already got, using the &
operator to piece together the various components, along the lines of:
ActiveChart.SeriesCollection(1).XValues = "='Traffic model'!R" & StartRow
&
"C" & StartCol & ":R" & EndRow & "C" & EndCol

"gvm" wrote:

Another question related to my recent post. Some search hits come close
to a
solution but don't quite hit the spot. I am altering recorded macros. The
line I want to change is:
ActiveChart.SeriesCollection(1).XValues = "='Traffic model'!R14C7:R32C7"

I want to change !R14C7:R32C7 to a form where each row and column number
is
a variable.
TIA again ... Greg



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
How do I Creat Comparision chart taking two variables on y-axis? Suny Charts and Charting in Excel 1 July 25th 07 03:04 PM
Chart two variables with differing values Dan Charts and Charting in Excel 2 January 23rd 06 07:07 PM
how to put x axis values in the chart instead of x axis labels Sinclair Charts and Charting in Excel 1 June 21st 05 11:04 AM
How do I change X-Axis values in a chart with 2 Y-Axis? ESGLCC Charts and Charting in Excel 1 May 4th 05 02:41 PM
Assigning values from a selected range to individual variables Dr. Schwartz[_3_] Excel Programming 5 January 27th 04 02:27 PM


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