+ Reply to Thread
Results 1 to 4 of 4

Same chart, multiple worksheets, dynamic data ranges

  1. #1
    Registered User
    Join Date
    05-08-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    2

    Same chart, multiple worksheets, dynamic data ranges

    Hi Everyone,

    I have an Excel workbook of 30 worksheets that I would like to put the same type of chart on. However, the number of columns in each of the worksheet differs. Do you know a way I can use a VBA macro to create the same type of chart, for each of the 30 sheets, while allowing the number of columns to differ in each of the worksheets? I have the VBA code to do the chart already and it does work, given that my data dimensions are static. Unfortunately, my data is not that way though.

    Thanks,

    tiredone

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Same chart, multiple worksheets, dynamic data ranges

    Post your sample workbook with 2-3 pages in it and the code you're using currently, I'll see if I can adapt it for you to be dynamic.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-08-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    2

    Re: Same chart, multiple worksheets, dynamic data ranges

    sample code:

    Please Login or Register  to view this content.
    sample workbook, worksheet 1 'GROUP 1'

    YEAR RED GREEN YELLOW
    2012 30 30 40
    2013 40 30 20
    2014 30 35 35


    WORKSHEET2 'GROUP 2'
    YEAR RED GREEN YELLOW ORANGE
    2012 30 30 30 10
    2013 20 20 30 30
    2014 30 35 35 0


    WORKSHEET 3 'GROUP 3'

    YEAR RED GREEN YELLOW ORANGE PURPLE
    2012 0 0 30 20 50
    2013 20 20 30 30 0
    2014 20 35 10 0 35
    Attached Files Attached Files
    Last edited by JBeaucaire; 05-16-2015 at 12:08 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Same chart, multiple worksheets, dynamic data ranges

    Like so:
    Please Login or Register  to view this content.

+ 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: 0
    Last Post: 08-05-2013, 11:34 AM
  2. Replies: 2
    Last Post: 07-17-2012, 09:18 PM
  3. Replies: 0
    Last Post: 07-06-2006, 12:00 AM
  4. Looping through dynamic ranges from multiple worksheets
    By TechWrangler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2006, 03:20 PM
  5. copy dynamic ranges in multiple workbooks based on a data in 1 col
    By jbsand1001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2005, 03:06 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