Results 1 to 6 of 6

Thread: Automate bar graph for each line item in a dataset

  1. #1
    Neophyte excelnewbie12345's Avatar
    Join Date
    Jun 2019
    Posts
    3
    Articles
    0
    Excel Version
    16.24

    Automate bar graph for each line item in a dataset



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I am new to excel and I'm trying to create a separate bar graph for each line item in my dataset. Is there a way to automate this process? The data is: class name, average grade for the final exam, final grade for the semester, and the delta. Right now I'm creating each bar graph manually and I know there has to be a way to automate this.

  2. #2
    Administrator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,680
    Articles
    0
    Excel Version
    2010 on Xubuntu
    Hi and welcome
    please post a sample sheet with some data and expected results ( no pics please) Click Go advanced - Manage attachments
    Thank you Ken for this secure forum.

  3. #3
    Neophyte excelnewbie12345's Avatar
    Join Date
    Jun 2019
    Posts
    3
    Articles
    0
    Excel Version
    16.24

    Bar graph example

    Hi,

    Thank you for your response.
    Attached Files Attached Files

  4. #4
    Magician navic's Avatar
    Join Date
    Aug 2013
    Location
    Europe, Croatia
    Posts
    887
    Articles
    0
    Excel Version
    Excel 2013
    Quote Originally Posted by excelnewbie12345 View Post
    create a separate bar graph for each line item in my dataset.
    See if the solution is acceptable to you.
    Attached Files Attached Files
    My personal Web Excel Tutorials
    Attention! In the formulas as a delimiter I use a semicolon (; ) if you using my formula, then perhaps you need to use a comma (,)
    Also for a decimal number I use a comma (,) you may need to use point (.) instead of

  5. #5
    Neophyte excelnewbie12345's Avatar
    Join Date
    Jun 2019
    Posts
    3
    Articles
    0
    Excel Version
    16.24

    Automate Bar graph in a data set

    Quote Originally Posted by navic View Post
    See if the solution is acceptable to you.
    Hi there,

    Thank you for your response. Were these bar graphs automatically created? I have to create each one manually. I was wondering if there was a way to automate the process.

    THank you, again.

  6. #6
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,618
    Articles
    0
    Excel Version
    365
    The attached has a button on the sheet which runs the following macro.
    It takes the first (only) chart on the sheet and repeatedly copies it and adjusts its source data. So set that chart as you'd like it first. You can make your own adjustments to the code (see comments therein).
    Code:
    Sub blah()
    lr = Cells(Rows.Count, "A").End(xlUp).Row
    Set SceChart = ActiveSheet.ChartObjects(1)
    Set destn = Range("F11")    'where the top of the first new chart will be
    For r = 3 To lr
      With SceChart.Duplicate
        .Top = destn.Top    'position the new chart's top
        .Left = SceChart.Left    'position the new chart's left (in line with the first chart).
        .Chart.SetSourceData Source:=Range("Sheet1!$A$1:$D$1,Sheet1!$A$" & r & ":$D$" & r)
        Set destn = destn.Offset(8)    'where the top of the next new chart will be (8 cells down from the previous one)
      End With
    Next r
    End Sub
    Attached Files Attached Files
    Last edited by p45cal; 2019-07-07 at 12:23 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •