Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 58
Default Crossing Axis Values

Hi everyone

I have a chart where the values can be modified depending on some filters

What I need is that the values where the axis crosses change automatically
as well depending on the value of one cell for the X axis and another cell
for the Y axis
Instead of manually modify the values

is this posible??
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,722
Default Crossing Axis Values

You'd need to do this using VBA. An example code that could be run with the
chart selected:

Sub ChartAxis()
With ActiveChart
'This is the y-axis
.Axes(xlCategory).CrossesAt = Range("A2").Value

'This is the x-axis
.Axes(xlValue).CrossesAt = Range("A3").Value
End With
End Sub


Depending on whether your chart is on a seperate sheet or not, you could
automate this using either a Chart_Activate event, or a Worksheet_Change
event.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Alonso" wrote:

Hi everyone

I have a chart where the values can be modified depending on some filters

What I need is that the values where the axis crosses change automatically
as well depending on the value of one cell for the X axis and another cell
for the Y axis
Instead of manually modify the values

is this posible??

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 58
Default Crossing Axis Values

Thanks Luke

I guess the same goes for the max and min values for each axis, right??
could you provide the VBA for this??

and have all in one button
so after the filters are used
use the button and update the XY chart??



"Luke M" wrote:

You'd need to do this using VBA. An example code that could be run with the
chart selected:

Sub ChartAxis()
With ActiveChart
'This is the y-axis
.Axes(xlCategory).CrossesAt = Range("A2").Value

'This is the x-axis
.Axes(xlValue).CrossesAt = Range("A3").Value
End With
End Sub


Depending on whether your chart is on a seperate sheet or not, you could
automate this using either a Chart_Activate event, or a Worksheet_Change
event.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Alonso" wrote:

Hi everyone

I have a chart where the values can be modified depending on some filters

What I need is that the values where the axis crosses change automatically
as well depending on the value of one cell for the X axis and another cell
for the Y axis
Instead of manually modify the values

is this posible??

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
Secondary Axis not crossing at zero TC2004 Charts and Charting in Excel 5 April 5th 23 01:12 PM
Data labels along below x axis when y axis has negative values Andrew Charts and Charting in Excel 1 July 3rd 08 08:36 PM
2-axis problem with horizontal crossing BorisS Charts and Charting in Excel 1 July 3rd 08 03:49 AM
How to insert X axis scale values next to axis and X axis grid lin vp23larry Charts and Charting in Excel 2 June 23rd 05 03:45 PM
Hiding Values Below Z Axis Minimum Value on Axis Charts TryingToExcel Charts and Charting in Excel 1 February 18th 05 03:55 AM


All times are GMT +1. The time now is 04:27 PM.

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"