Consulting

Results 1 to 5 of 5

Thread: Solved: Changing position of Chart XValues

  1. #1
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location

    Question Solved: Changing position of Chart XValues

    Hi all,

    I am creating a chart as a new sheet from a command button on a full screen sheet (see attached). On a particular Chart (Tilt) I have typical values in the range of -30 to 30 (Representing Up and Down Tilt angles from 0deg (Level))

    When the chart is plotted the XValues are placed below the '0' line in the Plot Area.

    Is it possible to change the position of these to be in the Chart Area as in the other charts.

    Best Reards

    Paul Ked
    Semper in excretia sumus; solum profundum variat.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Like this?
    [VBA] With ActiveChart
    .HasAxis(xlCategory, xlPrimary) = True
    .HasAxis(xlValue, xlPrimary) = True
    .Axes(xlValue).CrossesAt = -30
    End With
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Shear brilliance

    Many thanks

    Paul Ked
    Semper in excretia sumus; solum profundum variat.

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    For things like this, try the macro recorder on a simple chart. That's where the solution came from.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Did try to (most of the code has been 'written' this way) but couldn't fathom it out.

    'Must try harder' next time

    Thanks again

    Paul Ked
    Semper in excretia sumus; solum profundum variat.

Posting Permissions

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