+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Contributor
    Join Date
    10-01-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2003
    Posts
    122

    Labels on X axis

    Hello there,

    I need help with something that I guess is quite basic, putting labels on the X axis using VBA

    the graphs I need are extremely simple
    there are two columns that originate from a single series, two cells one on top of the other (D27:D28)
    on the X axis I want to use the labels that are two columns to the left of the data (B27:B28), that's all I need.

    However it is so basic that I am finding nothing looking around in forums.

    Today I started using macros -- all in this the macro of the workbook I compiled looking around in forums and help files

    I attach the file --

    thanks a lot!
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,941

    Re: How to put labels in the X axis

    Code:
    Sub MakeChart()
    
        Dim rngData As Range
        
        Set rngData = ActiveSheet.Range("B27:B28,D27:D28")
        With ActiveSheet.Shapes.AddChart(xlColumnClustered, 20, 20, 300, 200).Chart
            .SetSourceData rngData
        End With
        
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-13-2009
    Location
    Gainesville, FL
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to put labels in the X axis

    I think I want to do something like what Bagullo wants. The attached output (data is sensitive so I generated a pdf), I want to replace the x-axis bin numbers with non-numerical labels. It's a scatter plot, but I want to replace the bin number values with names. Any ideas?
    Thank you,
    ML
    Attached Files Attached Files
    Last edited by MattLangholtz; 11-13-2009 at 02:16 PM. Reason: Attachment change.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,941

    Re: Labels on X axis

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Cheers
    Andy
    www.andypope.info

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.2.0