+ Reply to Thread
Results 1 to 3 of 3

Easy question?

  1. #1
    Marc
    Guest

    Easy question?

    I have this code with button on click event and it doesn't work.

    Worksheets("Data").Range("A4:C4").Copy
    ActiveSheet.Paste Destination:=Worksheets("Graph").Range("A2:C2")
    Worksheets(8).Activate

    ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0
    Application.CutCopyMode = False

    This is only chart in workbook.

    Error is in line (highlights this line when running code)
    ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0

    If someone can help.

    Thanks in advance



  2. #2
    Don Guillett
    Guest

    Re: Easy question?

    There should be no error in that line. Perhaps it is NOT the active sheet?
    Is sheet(8) also Graph? The sheet does NOT have to be active.

    Worksheets("Data").Range("A4:C4"). _
    Copy Worksheets("Graph").Range("A2:C2")
    Worksheets(8).ChartObjects(1). _
    Chart.Axes(claque).MinimumScale = 0

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Marc" <marcdontsend@hotmail.com> wrote in message
    news:d408s5$qet$1@ss405.t-com.hr...
    > I have this code with button on click event and it doesn't work.
    >
    > Worksheets("Data").Range("A4:C4").Copy
    > ActiveSheet.Paste Destination:=Worksheets("Graph").Range("A2:C2")
    > Worksheets(8).Activate
    >
    > ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0
    > Application.CutCopyMode = False
    >
    > This is only chart in workbook.
    >
    > Error is in line (highlights this line when running code)
    > ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0
    >
    > If someone can help.
    >
    > Thanks in advance
    >
    >




  3. #3
    Don Guillett
    Guest

    Re: Easy question?

    ALSO
    In case your graph is on a separate graph sheet instead of imbedded, change
    WORKsheets to just Sheets and for the sheet number sheet8

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Don Guillett" <donaldb@281.com> wrote in message
    news:%23onbWOBRFHA.688@TK2MSFTNGP10.phx.gbl...
    > There should be no error in that line. Perhaps it is NOT the active sheet?
    > Is sheet(8) also Graph? The sheet does NOT have to be active.
    >
    > Worksheets("Data").Range("A4:C4"). _
    > Copy Worksheets("Graph").Range("A2:C2")
    > Worksheets(8).ChartObjects(1). _
    > Chart.Axes(claque).MinimumScale = 0
    >
    > --
    > Don Guillett
    > SalesAid Software
    > donaldb@281.com
    > "Marc" <marcdontsend@hotmail.com> wrote in message
    > news:d408s5$qet$1@ss405.t-com.hr...
    > > I have this code with button on click event and it doesn't work.
    > >
    > > Worksheets("Data").Range("A4:C4").Copy
    > > ActiveSheet.Paste Destination:=Worksheets("Graph").Range("A2:C2")
    > > Worksheets(8).Activate
    > >
    > > ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0
    > > Application.CutCopyMode = False
    > >
    > > This is only chart in workbook.
    > >
    > > Error is in line (highlights this line when running code)
    > > ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0
    > >
    > > If someone can help.
    > >
    > > Thanks in advance
    > >
    > >

    >
    >




+ 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