+ Reply to Thread
Results 1 to 4 of 4

Create A chart for each row of data VBA

  1. #1
    Registered User
    Join Date
    08-16-2019
    Location
    Perth,Australia
    MS-Off Ver
    365
    Posts
    2

    Create A chart for each row of data VBA

    Hello,
    I am on a slow long learning curve with VBA, I struggle with a few aspects but I persevere.

    I have some rows data (Could be 10 rows could be 12 and so on)
    I can create a chart for one row of data, but I do not want to do this for each row the long way.
    I would appreciate some guidance on putting my code into a Loop? so the code will just create as many charts as there are rows. Here is my code for the first row of data used for a chart

    Sub TryChrt()
    Dim chrt As Chart
    Set chrt = Charts.Add
    Set chrt = chrt.Location(where:=xlLocationAsObject, Name:="Charts")

    With chrt
    .ChartType = xlColumnClustered
    .SeriesCollection.NewSeries
    .FullSeriesCollection(1).Values = "=Loading!$B$2:$AX$2"
    .FullSeriesCollection(1).Name = "=Loading!$A$2"
    .FullSeriesCollection(1).XValues = "=Loading!$B$1:$AZ$1"
    .FullSeriesCollection(1).Select
    .ChartGroups(1).GapWidth = 10
    .HasLegend = False
    End With

    End Sub

    Appreciate any assistance in this query
    Thanks
    JB

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Create A chart for each row of data VBA

    Hey. This might work for you. Note that it also tries to re-arrange the charts so they don't overlap:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    08-16-2019
    Location
    Perth,Australia
    MS-Off Ver
    365
    Posts
    2

    Re: Create A chart for each row of data VBA

    And thats a big WOW! from me.... Thank you very much.
    It runs great.
    Now i just have to take time and understand the code

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Create A chart for each row of data VBA

    No problem. Perhaps you could pass on a message to Steve Smith to throw his wicket away please

    WBD

+ 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. [SOLVED] How would i create a Chart for this Data
    By andy_tap in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-07-2016, 09:01 AM
  2. Macro to filter data and then create a chart with information from this data
    By bent_dietrich in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2014, 04:28 AM
  3. How to create a bar chart with 3 set of data?
    By ufojoe111 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-08-2013, 08:05 AM
  4. Replies: 1
    Last Post: 03-12-2013, 01:39 PM
  5. How to create a Pie Chart from this data ...
    By p_625 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-30-2008, 08:54 AM
  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] Chart data file lost - need to re-create from chart?
    By LostExcelData in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-07-2006, 03:00 PM

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