+ Reply to Thread
Results 1 to 4 of 4

Can a zoom in/out chart be made?

  1. #1
    Ram Nemesis
    Guest

    Can a zoom in/out chart be made?

    How can I make a chart which can be zoomed in or out using the mouse or a
    button

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Record a macro for changing the scale of your graph. Once this is done, you have automatic code for the recorded macro to zoom in / out. In the code you can add a variable which increments either way, which is further assigned to the scale of the graph. Assign this macro to a button, and your work is done. If you need more detais, revert back.

    - Mangesh

  3. #3
    John Mansfield
    Guest

    RE: Can a zoom in/out chart be made?

    Ram,

    One method would be to use macros. You would add a user form with a
    scrollbar to your spreadsheet. The scrollbar would zoom the sheet and in
    turn zoom the chart.

    To do so, create a new code module and call it “Module1�. Add this code to
    the module:

    Sub ShowForm()
    UserForm1.Show
    End Sub

    Go to the sheet where your chart resides. Add a button to that sheet via
    the Forms toolbar that will activate the scroll form described below. Attach
    the macro above to that button.

    Next, create a new user form and name it “UserForm1�. Open the new user
    form in design mode. Add a scrollbar to the user form via the VBA controls
    toolbar and name it SBZoom. Add this code to the code module in the user
    form:

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

    Private Sub SBZoom_Change()
    With ActiveWindow
    .Zoom = ScrollBarZoom.Value
    .ScrollColumn = ScrollBarColumns.Value
    .ScrollRow = ScrollBarRows.Value
    End With
    End Sub

    As you move the scroll bar, the change event will change the size of the
    sheet which will in turn size the chart.

    ----
    Regards,
    John Mansfield
    http://www.pdbook.com



    "Ram Nemesis" wrote:

    > How can I make a chart which can be zoomed in or out using the mouse or a
    > button


  4. #4
    Registered User
    Join Date
    01-29-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Can a zoom in/out chart be made?

    Here's a solution for adding a zoom button (shape) to your chart to enlarge the chart for easier viewing. Works great with panel charts or sparklines on a dashboard. You can download the workbook containing the macro and instructions for free at

    http://www.excelcampus.com/vba/zoom-on-excel-charts

    See the animated image for an example.

    Zoom-on-Excel-Charts.gif

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1