+ Reply to Thread
Results 1 to 2 of 2

Couple of questions on graphing with VBA

  1. #1
    Registered User
    Join Date
    04-06-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Couple of questions on graphing with VBA

    Hi Guys!

    I'm sorry for spamming but the last post was inaccurate for my problem !

    So I have a fully functioning code:

    Sub Test5()

    With Sheets("Sheet4")

    Set range1 = Range("sheet4!a:a")
    Set range2 = Range("sheet4!b:b")

    Set myrange = Union(range1, range2)

    Charts.Add
    With ActiveChart
    .ChartType = xlLine
    .SetSourceData Source:=myrange
    .PlotBy = xlColumns
    .Location Where:=xlLocationAsObject, Name:="Sheet4"
    End With
    End With

    End Sub


    This code creates a graph for me using input data from columns A and B. However I have a couple of questions/problems.


    1) If you guys run it with some data, the graph comes out fine but some extra lines come out as well. My question is, how do you delete those? (It's like graphing column a twice)

    2) How do I add axis labels on the graph? is there some extra coding I need to do?

  2. #2
    Registered User
    Join Date
    04-06-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Couple of questions on graphing with VBA

    For anyone who's curious, please see attached file for my problems. Thank you!!!!Question.xlsm

+ 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