+ Reply to Thread
Results 1 to 5 of 5

Macro to create chart using XLtoRight Variable for adding column data

  1. #1
    Registered User
    Join Date
    07-07-2015
    Location
    Wash DC
    MS-Off Ver
    10
    Posts
    57

    Macro to create chart using XLtoRight Variable for adding column data

    I have a spreadsheet that is being updated frequently... Once data is added I have to manually re-graph the variable.... The code is as follows

    Please Login or Register  to view this content.
    Right now the graph only goes out to the Y column.. As time goes on - it's going to continue to grow X, AA, etc.... I was hoping to write a macro that would identify the LastColumn variable ala the XltoRight parameter ... But so for I can't get it to work (attempts aren't in the code)...

    TIA
    Jason

  2. #2
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Macro to create chart using XLtoRight Variable for adding column data

    Hello my friend

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-07-2015
    Location
    Wash DC
    MS-Off Ver
    10
    Posts
    57

    Re: Macro to create chart using XLtoRight Variable for adding column data

    hmm never used the .CurrentRegion

    Im trying it now - but to be honest I am a bit clueless

  4. #4
    Registered User
    Join Date
    07-07-2015
    Location
    Wash DC
    MS-Off Ver
    10
    Posts
    57

    Re: Macro to create chart using XLtoRight Variable for adding column data

    couldn't get it to work....

    The previous things I tried were replacing

    'ActiveChart.SeriesCollection(1).Values = "=MeFRRMaster!$B$9:$Y$9"

    with both

    ActiveChart.SeriesCollection(1).Values = "='MeFRRMaster'!$B$9:$Y$" & LastRow

    or this

    ActiveChart.SeriesCollection(1).Values = ("'MeFRRMaster'!$B$9:$Y$" & LastRow)

    and neither worked.....


    Ack

  5. #5
    Registered User
    Join Date
    07-07-2015
    Location
    Wash DC
    MS-Off Ver
    10
    Posts
    57

    Re: Macro to create chart using XLtoRight Variable for adding column data

    Ack... I am an idiot

    ActiveChart.SeriesCollection(1).Values = "='MeFRRMaster'!$B$9:$Y$" & LastRow - wouldn't work .... I am looking for &B$9:$Y$9 - using "$B$9:$Y$" & LastRow" would give me b9 to y24 (or however many columns I had - which is just wrong... I need $B$9:$ChangingVariable$9

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 10-29-2015, 10:58 AM
  2. [SOLVED] Macro to create columns by referencing a variable column
    By mactoolsix in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-11-2014, 05:19 PM
  3. Column Chart with Variable number of rows of data
    By zhavier in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 05-19-2014, 09:42 AM
  4. Create a chart from data in every other column
    By Nerdio in forum Excel Charting & Pivots
    Replies: 15
    Last Post: 07-23-2013, 09:05 PM
  5. [SOLVED] Select range starting from B2 End(xlToRight) -1 column
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-19-2013, 01:33 PM
  6. create a chart with variable Chart data
    By demuro1 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-06-2008, 08:54 AM
  7. [SOLVED] How do I create a rolling average chart, adding most recent data?
    By Doug@NxEdge in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-04-2005, 10:30 PM

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