Results 1 to 3 of 3

automatically creating multiple charts with similar layout and put them in a single sheet

Threaded View

Celeste84 automatically creating... 11-27-2013, 10:58 AM
6StringJazzer Re: automatically creating... 11-27-2013, 12:01 PM
Celeste84 Re: automatically creating... 11-27-2013, 12:06 PM
  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Rome
    MS-Off Ver
    Excel 2007
    Posts
    14

    automatically creating multiple charts with similar layout and put them in a single sheet

    Dear Excel experts,
    So far I have found this forum incredibly helpful as I am new to excel/VBA, so I hope you can help me once more!
    I have found this very well written macro on http://www.excelforum.com/excel-char...te-graphs.html, and I copied it below.
    I have modified one line so to have it running on a selection of data but I am still struggling to do the following:

    1/ I want to create a separate sheet where all the graphs are stored rather than having a sheet for each graph
    2/ The single charts are time series graphs so they all have the same interval range on the X-axis and one single series of values...how do I instruct excel to understand that?
    3/ I want to apply my ad-hoc graphical template to each chart (template already saved and ready)

    Can someone tell me how to modify the code below to incorporate 1-3? Thanks soooooo much!

    ---------------------------------
    Sub OneChartPerRow()
       Dim rCat As Range
       Dim rVal As Range
       Dim rUsed As Range
       Dim iRow As Long
       Dim cht As Chart
       
       Set rUsed = Selection
       Set rCat = rUsed.Rows(1)
       
       For iRow = 2 To rUsed.Rows.Count
          Set rVal = rUsed.Rows(iRow)
          Set cht = Charts.Add
          cht.Name = rVal.Cells(1, 1)
          With cht
             .SetSourceData Source:=Union(rCat, rVal)
             .HasTitle = False
             .HasTitle = True
             With .ChartTitle
                .Text = rVal.Cells(1, 1)
             End With
          End With
       Next
    End Sub
    Moderator's note: Added code tags and corrected typo in thread title
    Last edited by 6StringJazzer; 11-27-2013 at 12:02 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Pull data if there is any from a single column in multiple worksheets into a single sheet
    By bcas77 in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 07-11-2013, 01:22 PM
  2. Replies: 3
    Last Post: 01-30-2013, 07:59 PM
  3. Multiple lines of similar data to one single line
    By T_Van in forum Excel General
    Replies: 7
    Last Post: 02-27-2012, 06:03 PM
  4. Creating multiple pivot tables for similar data
    By shockeroo in forum Excel General
    Replies: 2
    Last Post: 03-31-2010, 11:05 AM
  5. Automatically updated chats x values
    By Beltzer71 in forum Excel Charting & Pivots
    Replies: 14
    Last Post: 11-20-2008, 04:44 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