how to decode a vba code

pphate200888's picture

Option Explicit

Dim wbk As Workbook
Dim CompanyO As Worksheet
Dim cht As ChartObject

Sub UpdateCht()
Set wbk = ThisWorkbook
Set CompanyO = wbk.ActiveSheet
Set cht = CompanyO.ChartObjects("Chart 6")

With cht

If CompanyO.Range("J13").Value = CompanyO.Range("Company_Name").Value Then
.Chart.SeriesCollection(2).ChartType = xlColumnClustered
.Chart.SeriesCollection(1).AxisGroup = 2
.Chart.Refresh
Else
.Chart.SeriesCollection(2).ChartType = xlLine
.Chart.SeriesCollection(1).AxisGroup = 1
.Chart.Refresh
End If
End With

Application.ScreenUpdating = False
'CompanyO.Range("A1").Select
Application.ScreenUpdating = True

End Sub