Results 1 to 9 of 9

Dynamic Excel Chart: Pulling Data from Two Different Tables (VBA?)

Threaded View

  1. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Dynamic Excel Chart: Pulling Data from Two Different Tables (VBA?)

    you really dont need VBA to achieve what you are asking but as you asked for a VBA specific response

    heres my code and attached file
    i deleted all your other charts and just left one and named it chart 1

    the title is based on cell o6 so thats why it isnt in the code

    Sub DynamicChart()
        
        Select Case Range("O4")
        
        Case Is = 1
            'maximum value
            ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1).Values = Range("L14:P14")
            ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1).Format.Fill.ForeColor.RGB = RGB(0, 0, 255) 'RGB for blue
        
        Case Else
            'everything else
            ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1).Values = Range(Range("a12").Offset(Range("o4"), 3), Range("a12").Offset(Range("o4"), 7))
            ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1).Format.Fill.ForeColor.RGB = RGB(255, 102, 0) 'RGB for orange
        
        End Select
        
    End Sub
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 02-27-2015, 05:23 PM
  2. pulling data from web with dynamic url
    By Powermaniac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2014, 02:49 PM
  3. Uploading data into tables with a button click & pulling back the data from the table
    By tvsreekanth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2013, 07:29 AM
  4. Replies: 4
    Last Post: 05-24-2011, 03:11 AM
  5. Pulling data from several tables into one sheet?
    By Grim46 in forum Excel General
    Replies: 2
    Last Post: 12-06-2010, 12:45 PM
  6. Excel Tables dynamic data copying
    By gigiw1986 in forum Excel General
    Replies: 1
    Last Post: 04-24-2010, 11:12 AM
  7. Help with Excel tables to copy dynamic data update
    By gigiw1986 in forum Excel General
    Replies: 1
    Last Post: 04-24-2010, 06:54 AM

Tags for this Thread

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