+ Reply to Thread
Results 1 to 3 of 3

VBA code does not work in Excel 2007

  1. #1
    Registered User
    Join Date
    09-01-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    VBA code does not work in Excel 2007

    Hello,

    I'm a beginner with Excel programming. I inherited a report developed in Excel 2003. The report has a few charts. The axes on the chart change based on a VBA code. The scale changes in 2003 but does not work in 2007. So the graph appears to cut of the values falling out of range. Here is the code. Any help is appreciated.

    Private Sub ComboBox1_Change()
    On Error GoTo 1
    With Worksheets("CPC, % Supply-NPSR").ChartObjects(2).Chart.Axes(xlValue)
    .MaximumScale = Range("AF2").Value
    .MinimumScale = Range("AF3").Value
    End With

    With Worksheets("CPC, % Supply-NPSR").ChartObjects(1).Chart.Axes(xlValue)
    .MaximumScale = Range("AE2").Value
    .MinimumScale = Range("AE3").Value
    End With
    Last edited by ExcelNovice12; 09-01-2009 at 11:57 PM. Reason: adding code tags. Hope I got this right.

  2. #2
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146

    Re: VBA code does not work in Excel 2007

    First thing to check is that you've got your macros enabled.

    Once you've got that checked, are you getting any specific error messages?

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA code does not work in Excel 2007

    Welcome to the forum, ExcelNovice.

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ 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