ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   How do I create a custom scroll bar on a 3D Pivot Chart? (https://www.excelbanter.com/charts-charting-excel/40-how-do-i-create-custom-scroll-bar-3d-pivot-chart.html)

JRW in Idaho

How do I create a custom scroll bar on a 3D Pivot Chart?
 
I have created a 3D Pivot Chart from a Pivot Table and have seen examples
that have custom scroll bars to control the zoom and scroll by axis and other
features of the chart. How is this accomplished?

John Mansfield

One way - you can add these effects by adding defined
ranges to the chart. You might want to look at some of
the charting examples at Stephen Bullen's site:

http://oaltd.co.uk/Excel/Default.htm

Another way - this VBA code can be added to a userform to
cause the worksheet in which an embedded chart resides to
zoom in, zoom out, move up, and/or move down. You will
need to add three scroll bars to the user form. One will
zoom the chart in or out, one will move it to the right or
left, and the last one will move it up or down.

Private Sub UserForm_Initialize()
' Zoom
With ScrollBarZoom
.Min = 10
.Max = 400
.SmallChange = 1
.LargeChange = 10
.Value = ActiveWindow.Zoom
End With

' Horizontally scrolling
With ScrollBarColumns
.Min = 1
.Max = 256
.Value = ActiveWindow.ScrollColumn
.LargeChange = 25
.SmallChange = 1
End With

' Vertically scrolling
With ScrollBarRows
.Min = 1
.Max = ActiveSheet.Rows.Count
.Value = ActiveWindow.ScrollRow
.LargeChange = 25
.SmallChange = 1
End With
End Sub

Private Sub ScrollBarZoom_Change()
With ActiveWindow
.Zoom = ScrollBarZoom.Value
LabelZoom = .Zoom & "%"
.ScrollColumn = ScrollBarColumns.Value
.ScrollRow = ScrollBarRows.Value
End With
End Sub

Private Sub ScrollBarColumns_Change()
ActiveWindow.ScrollColumn = ScrollBarColumns.Value
End Sub

Private Sub ScrollBarRows_Change()
ActiveWindow.ScrollRow = ScrollBarRows.Value
End Sub

Regards,

John Mansfield

-----Original Message-----
I have created a 3D Pivot Chart from a Pivot Table and

have seen examples
that have custom scroll bars to control the zoom and

scroll by axis and other
features of the chart. How is this accomplished?
.



All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com