Create a Column Chart

     

  • This workbook enables the user to create the column chart with single series collection
  • Click on below image to watch the video
  •  

    Download The Workbook

     

     

    Sub Column_Chart_Single_Series()
    On Error Resume Next
    'Define variable for worksheet
    Dim sh As Worksheet
    Set sh = ThisWorkbook.Sheets.Add(after:=ThisWorkbook.Worksheets(Sheets.Count), Count:=1)
    sh.Activate
    sh.Name = "Single Column Chart"
    ActiveWindow.DisplayGridlines = False

    'Copy the data from Datasheet to newly created sheet
    Dim Datasheet As Worksheet
    Set Datasheet = ThisWorkbook.Sheets("Data Sheet")
    Datasheet.Range("B4:C9").Copy sh.Range("B4")

    'Define the Chart Object in worksheet
    Dim ch As ChartObject

    'Define the Measures of chart
    With sh.Range("H3:P20")
    Set ch = sh.ChartObjects.Add( _
    Left:=.Left, _
    Top:=.Top, _
    Width:=.Width, _
    Height:=.Height)
    End With

    'Select chart Property from chart object
    With ch.Chart
    .ChartType = xlColumnClustered
    .SetSourceData sh.Range("B4:C9"), PlotBy:=xlColumns
    End With

    ch.Name = "Jan Month Sales Report"

    End Sub