Bulk Chart Creation

friendlyfan

New Member
Joined
Nov 26, 2005
Messages
5
Hello. When making charts in Excel, does anyone know whether there is a way to input Source Data (e.g. Name and Values) in bulk rather than manually inputting ranges one-by-one? I have a spreadsheet that has all of the ranges for all my series. I also have a chart template. Thanks in advance for your help!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This is from Mr Aaron Blood's answer to a similar request. If you want the workbook, let me know and I can PM it to you (If Mr Aaron Blood does not mind). I guess we can't attach workbooks.

Code:
Option Explicit

Sub Chart_Pics()
    
    Dim n As Integer, i As Integer
    Dim ChgCell As Range, OutCell As Range
    Dim AllCharts As ShapeRange
    
    Set AllCharts = ActiveSheet.ChartObjects.ShapeRange
    AllCharts.Select
    
    Set ChgCell = Range("VBA_ChgCell")
    Set OutCell = Range("VBA_OutCell")

    n = Range("VBA_n").Value
    
    Call Del_Pics

    For i = 1 To n
        ChgCell.Value = i
        AllCharts.Select
        Selection.CopyPicture _
            Appearance:=xlScreen, _
            Format:=xlPicture
        OutCell.Offset((i - 1) * 14, 0).Select
        Selection.Offset(1, -1).Value = i
        ActiveSheet.Paste
    Next i
    
    ChgCell.Value = 1

End Sub

Sub Del_Pics()
    Dim shp As Shape, r As Long, c As Long, OutCell As Range
    
    For Each shp In ActiveSheet.Shapes
        If shp.Name Like "Picture*" Then
            shp.Delete
        End If
    Next shp
    
    Set OutCell = Range("VBA_OutCell")
    r = OutCell.Row
    c = OutCell.Column - 1
    Range(Cells(r, c), Cells(65536, c)).ClearContents
    
End Sub

Regards and thanks to Aaron Blood
John[/code]
 
Upvote 0
Thanks for the input! I have never done any programming in Excel so I do not know how to use this information but I appreciate your assistance very much. Yes, I would like the workbook so I can learn how it is put together. I have a lot of learning to do. Any other suggestions on learning would be appreciated.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,388
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top