PC Review


Reply
Thread Tools Rate Thread

Crossing Axis Values

 
 
Alonso
Guest
Posts: n/a
 
      28th Jul 2009
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 With Quote
 
 
 
 
Luke M
Guest
Posts: n/a
 
      29th Jul 2009
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 With Quote
 
Alonso
Guest
Posts: n/a
 
      29th Jul 2009
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
y axis crossing - three series -markc Microsoft Excel Charting 0 18th Aug 2009 09:34 PM
Automatic Crossing Axis Values Alonso Microsoft Excel Programming 0 28th Jul 2009 06:17 PM
Secondary Axis not crossing at zero =?Utf-8?B?VEMyMDA0?= Microsoft Excel Charting 4 1st Nov 2007 02:42 PM
chart secondary axis crossing with x axis Matthew Dodds Microsoft Excel Programming 1 30th Nov 2005 09:34 PM
Conditional chart w/different x-axis crossing =?Utf-8?B?SmlsbA==?= Microsoft Excel Charting 0 29th Apr 2004 09:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 PM.