Results 1 to 3 of 3

Plotting graph with vba

Threaded View

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Plotting graph with vba

    Hi all, i have an error setting a range for my graph. Currently my code looks like this. Any solutions? Thanks in advance

    Dim r As Range
    set r = Range(Selection, Selection.End(xlToRight).Offset(0, -1))
    
        Charts.Add
      ActiveChart.ChartType = xlColumnClustered
        ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(r), PlotBy _
            :=xlRows
        ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R12C4:R12C15"
        ActiveChart.SeriesCollection(1).Name = "=Sheet1!R14C3"
        ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
        ActiveChart.HasLegend = False
        ActiveChart.HasDataTable = False
    Last edited by rename; 12-12-2012 at 10:09 PM.

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