Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to make Primary axis and Secondary X-axis have the same scale | Excel Discussion (Misc queries) | |||
How to place a secondary y axis bar in a bar chart next to two primary y axis bars? | Excel Discussion (Misc queries) | |||
How to place a secondary y axis bar in a bar chart next to two primary y axis bars? | Charts and Charting in Excel | |||
primary & secondary axis | Charts and Charting in Excel | |||
Secondary Axis Match Primary Axis Gridlines | Charts and Charting in Excel |