Results 1 to 8 of 8

data input Yaxis....need to change all charts

Threaded View

  1. #1
    Registered User
    Join Date
    01-13-2009
    Location
    West Virginia
    MS-Off Ver
    Excel 2007
    Posts
    25

    data input Yaxis....need to change all charts

    I have a form that allows the user to change the Yaxis. each sheet has a different chart. I have one sheet that is just the data.

    I have the code working except for one part. I know there has to be a way to do this so I dont have to add the code for every new chart sheet. This is what I have so far and it works.

    Private Sub Yaxis_Click()
    Sheets("Clean").Select
        ActiveSheet.ChartObjects("Chart 1").Activate
        ActiveChart.Axes(xlValue).MinimumScale = minyaxis.Value
        ActiveChart.Axes(xlValue).MaximumScale = maxyaxis.Value
        ActiveChart.Axes(xlValue).MajorUnit = increment.Value
        
        Sheets("sheet1").Select
        ActiveSheet.ChartObjects("Chart 1").Activate
        ActiveChart.Axes(xlValue).MinimumScale = minyaxis.Value
        ActiveChart.Axes(xlValue).MaximumScale = maxyaxis.Value
        ActiveChart.Axes(xlValue).MajorUnit = increment.Value
    How would I re-write this so it updates all the charts without me having to come and change the code for every chart?

    Thanks
    Last edited by mkbanister; 01-24-2009 at 03:48 PM. Reason: solved

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