Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 111
Default Re scale primary and secondary y axis using sliders request

To all,

I have an xy chart with a primary and secondary y axis. I would like
to be able to alter the scale of the primary and secondary y axis
independently using sliders ( one for each axis ). How is this
possible? Do I need to write a macro, or is there some other way to
control it?

Thanks in advance for your help,

Regards,

Joseph Crabtree
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Re scale primary and secondary y axis using sliders request

Hi,

That will require VBA code.

Assuming you add 2 scrollbars from the Control Toolbox to the worksheet you
could use the following code.
This will change the primary or Secondary Y axis of the 1st chart object on
the worksheet.

Private Sub ScrollBar1_Change()
' Primary Y Axis
ActiveSheet.ChartObjects(1).Chart.Axes(2, 1).MaximumScale =
ScrollBar1.Value

End Sub

Private Sub ScrollBar2_Change()
' Secondary Y Axis
ActiveSheet.ChartObjects(1).Chart.Axes(2, 2).MaximumScale =
ScrollBar2.Value

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"joecrabtree" wrote in message
...
To all,

I have an xy chart with a primary and secondary y axis. I would like
to be able to alter the scale of the primary and secondary y axis
independently using sliders ( one for each axis ). How is this
possible? Do I need to write a macro, or is there some other way to
control it?

Thanks in advance for your help,

Regards,

Joseph Crabtree


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 111
Default Re scale primary and secondary y axis using sliders request

On Nov 20, 1:47 pm, "Andy Pope" wrote:
Hi,

That will require VBA code.

Assuming you add 2 scrollbars from the Control Toolbox to the worksheet you
could use the following code.
This will change the primary or Secondary Y axis of the 1st chart object on
the worksheet.

Private Sub ScrollBar1_Change()
' Primary Y Axis
ActiveSheet.ChartObjects(1).Chart.Axes(2, 1).MaximumScale =
ScrollBar1.Value

End Sub

Private Sub ScrollBar2_Change()
' Secondary Y Axis
ActiveSheet.ChartObjects(1).Chart.Axes(2, 2).MaximumScale =
ScrollBar2.Value

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info"joecrabtree" wrote in message

...



To all,


I have an xy chart with a primary and secondary y axis. I would like
to be able to alter the scale of the primary and secondary y axis
independently using sliders ( one for each axis ). How is this
possible? Do I need to write a macro, or is there some other way to
control it?


Thanks in advance for your help,


Regards,


Joseph Crabtree- Hide quoted text -


- Show quoted text -


Thanks for that. Is there any way that I can define the minimum as
always 0, and have an upper maximum of 6000?

Thanks
  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Re scale primary and secondary y axis using sliders request

You would need to set the Max and Min properties of the scroll bars.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"joecrabtree" wrote in message
...
On Nov 20, 1:47 pm, "Andy Pope" wrote:
Hi,

That will require VBA code.

Assuming you add 2 scrollbars from the Control Toolbox to the worksheet
you
could use the following code.
This will change the primary or Secondary Y axis of the 1st chart object
on
the worksheet.

Private Sub ScrollBar1_Change()
' Primary Y Axis
ActiveSheet.ChartObjects(1).Chart.Axes(2, 1).MaximumScale =
ScrollBar1.Value

End Sub

Private Sub ScrollBar2_Change()
' Secondary Y Axis
ActiveSheet.ChartObjects(1).Chart.Axes(2, 2).MaximumScale =
ScrollBar2.Value

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info"joecrabtree"
wrote in message

...



To all,


I have an xy chart with a primary and secondary y axis. I would like
to be able to alter the scale of the primary and secondary y axis
independently using sliders ( one for each axis ). How is this
possible? Do I need to write a macro, or is there some other way to
control it?


Thanks in advance for your help,


Regards,


Joseph Crabtree- Hide quoted text -


- Show quoted text -


Thanks for that. Is there any way that I can define the minimum as
always 0, and have an upper maximum of 6000?

Thanks


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 to make Primary axis and Secondary X-axis have the same scale AdamCPTD Excel Discussion (Misc queries) 0 July 14th 06 02:14 PM
How to place a secondary y axis bar in a bar chart next to two primary y axis bars? Dmitry Excel Discussion (Misc queries) 3 May 4th 06 01:58 AM
How to place a secondary y axis bar in a bar chart next to two primary y axis bars? Dmitry Charts and Charting in Excel 2 May 4th 06 01:58 AM
primary & secondary axis Connie Martin Charts and Charting in Excel 3 March 8th 06 03:01 PM
Secondary Axis Match Primary Axis Gridlines [email protected] Charts and Charting in Excel 1 July 31st 05 09:23 PM


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