+ Reply to Thread
Results 1 to 2 of 2

Change Chart Data Range to show YTD data

  1. #1
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Change Chart Data Range to show YTD data

    Hi all,

    I am working on a dashboard and have set it so a user can select "YTD" (Year To Date) from a cell and up pops a chart ("Chart 48" to be exact) to show the YTD data which is fine.
    I am trying to get it so that when the chart is made visible the data source is updated to only show the months from Jan to the current month.

    At the moment the data range for this chart is Worksheets("DATAGRAPHS").Range("I4:K16") which is what I used when I made the chart.

    The code I have tried to set the data is:

    Please Login or Register  to view this content.
    Note: LastMonth is the row number which is figured out before this line is executed - I've declared this as an integer

    Any help on this would be appreciated, searches for a solution myself have hit a dead end...

    Thanks
    Harribone
    Last edited by Harribone; 02-04-2015 at 03:56 PM. Reason: Grammar
    Say thanks, click *

  2. #2
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Change Chart Data Range to show YTD data

    Update:
    Please Login or Register  to view this content.

    I've just modified the second line to change the row dynamically:

    Please Login or Register  to view this content.
    I forgot that you can always record a macro then modify the code!

+ 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: 2
    Last Post: 10-16-2014, 08:57 PM
  2. Charting data points and show a target range on the same chart.
    By Minireefkeeper in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 02-18-2006, 02:55 PM
  3. [SOLVED] change the data label of an chart to show qty
    By Trever B in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2005, 11:05 PM
  4. [SOLVED] How do I show range of data in an area chart?
    By slycke in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-01-2005, 09:05 AM
  5. [SOLVED] Can you show data in a data table but not plot it on the chart?
    By Armadillo in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-19-2005, 09:06 AM

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