'===================ABV PROJECT======================
'===================MODULE 1  =======================
Sub main ()
'you can edit this macro to execute any command when loading this workbook
'next line call the routine that fill the sheet
call absmain ()
End Sub

Sub absmain ()
'Do not edit this macro, changes will not be saved with the workbook!!!
Dim objchart  As Object
Dim objbutton As Object
Worksheets(1).Name = "A"
Worksheets(2).Name = "B"
Worksheets(3).Name = "C"
Worksheets(1).Activate
Columns("A").ColumnWidth = 5.428571
Columns("B").ColumnWidth = 5.428571
Cells(2,2).Formula="'Bar Chart "
Cells(2,2).Font.Size = 18
Cells(9,3).Formula="'Serie 1"
Cells(9,3).Borders.LineStyle = xlLineStyleContinuous
Cells(9,3).HorizontalAlignment = xlCenter
Cells(9,4).Formula="'Serie 2"
Cells(9,4).Borders.LineStyle = xlLineStyleContinuous
Cells(9,4).HorizontalAlignment = xlCenter
Cells(10,2).Formula="=+1"
Cells(10,3).Formula="=+B10*B10"
Cells(10,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(10,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(10,3).HorizontalAlignment = xlCenter
Cells(10,4).Formula="=C10-B10"
Cells(10,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(10,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(10,4).HorizontalAlignment = xlCenter
Cells(11,2).Formula="=+1+B10"
Cells(11,3).Formula="=+B11*B11"
Cells(11,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(11,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(11,3).HorizontalAlignment = xlCenter
Cells(11,4).Formula="=C11-B11"
Cells(11,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(11,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(11,4).HorizontalAlignment = xlCenter
Cells(12,2).Formula="=+1+B11"
Cells(12,3).Formula="=+B12*B12"
Cells(12,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(12,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(12,3).HorizontalAlignment = xlCenter
Cells(12,4).Formula="=C12-B12"
Cells(12,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(12,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(12,4).HorizontalAlignment = xlCenter
Cells(13,2).Formula="=+1+B12"
Cells(13,3).Formula="=+B13*B13"
Cells(13,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(13,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(13,3).HorizontalAlignment = xlCenter
Cells(13,4).Formula="=C13-B13"
Cells(13,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(13,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(13,4).HorizontalAlignment = xlCenter
Cells(14,2).Formula="=+1+B13"
Cells(14,3).Formula="=+B14*B14"
Cells(14,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(14,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(14,3).HorizontalAlignment = xlCenter
Cells(14,4).Formula="=C14-B14"
Cells(14,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(14,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(14,4).HorizontalAlignment = xlCenter
Cells(15,2).Formula="=+1+B14"
Cells(15,3).Formula="=+B15*B15"
Cells(15,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(15,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(15,3).HorizontalAlignment = xlCenter
Cells(15,4).Formula="=C15-B15"
Cells(15,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(15,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(15,4).HorizontalAlignment = xlCenter
Cells(16,2).Formula="=+1+B15"
Cells(16,3).Formula="=+B16*B16"
Cells(16,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(16,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(16,3).HorizontalAlignment = xlCenter
Cells(16,4).Formula="=C16-B16"
Cells(16,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(16,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(16,4).HorizontalAlignment = xlCenter
Cells(17,2).Formula="=+1+B16"
Cells(17,3).Formula="=B17*B17"
Cells(17,3).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
Cells(17,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(17,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(17,3).HorizontalAlignment = xlCenter
Cells(17,4).Formula="=C17-B17"
Cells(17,4).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
Cells(17,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(17,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(17,4).HorizontalAlignment = xlCenter
Cells(22,3).Formula="'Y axis label:"
Cells(22,4).Formula="'value"
Cells(23,3).Formula="'X axis label:"
Cells(23,4).Formula="'item"
Set objchart = ActiveWorksheet.ChartObjects.Add (287,102,397,273)
objchart.Activate
ActiveChart.ChartType = xlbarClustered
ActiveChart.SeriesCollection.NewSerie
ActiveChart.SeriesCollection(1).XValues = Range("B10:B17")
ActiveChart.SeriesCollection(1).Name = "C9"
ActiveChart.SeriesCollection(1).Values = Range("C10:C17")
ActiveChart.SeriesCollection(2).Name = "D9"
ActiveChart.SeriesCollection(2).Values = Range("D10:D17")
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "B2"
ActiveChart.Axes(xlCategory).HasTitle = True
ActiveChart.Axes(xlCategory).AxisTitle.Text = "D23"
ActiveChart.Axes(xlValue   ).HasTitle = True
ActiveChart.Axes(xlValue   ).AxisTitle.Text = "D22"
Worksheets(2).Activate
Cells(1,1).Formula="'Pie Chart "
Cells(1,1).Font.Size = 18
Cells(2,1).Formula="'Labels"
Cells(2,2).Formula="'Data"
Cells(3,1).Formula="'one"
Cells(3,2).Formula="=3"
Cells(4,1).Formula="'two"
Cells(4,2).Formula="=3"
Cells(5,1).Formula="'three"
Cells(5,2).Formula="=8"
Cells(6,1).Formula="'four"
Cells(6,2).Formula="=2"
Cells(7,1).Formula="'five"
Cells(7,2).Formula="=6"
Cells(8,1).Formula="'six"
Cells(8,2).Formula="=1"
Cells(9,1).Formula="'seven"
Cells(9,2).Formula="=4"
Cells(10,1).Formula="'height"
Cells(10,2).Formula="=2"
Set objchart = ActiveWorksheet.ChartObjects.Add (211,12,528,461)
objchart.Activate
ActiveChart.ChartType = xlPie
ActiveChart.SeriesCollection.NewSerie
ActiveChart.SeriesCollection(1).XValues = Range("A3:A10")
ActiveChart.SeriesCollection(1).Name = "'Serie2"
ActiveChart.SeriesCollection(1).Values = Range("B3:B10")
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "A1"
ActiveChart.Axes(xlCategory).HasTitle = True
ActiveChart.Axes(xlCategory).AxisTitle.Text = "A2"
ActiveChart.Axes(xlValue   ).HasTitle = True
ActiveChart.Axes(xlValue   ).AxisTitle.Text = "B2"
Worksheets(3).Activate
Columns("A").ColumnWidth = 4.285714
Columns("B").ColumnWidth = 6.571429
Cells(1,1).Formula="'XY Chart "
Cells(1,1).Font.Size = 18
Cells(9,3).Formula="'Serie 1"
Cells(9,3).Borders.LineStyle = xlLineStyleContinuous
Cells(9,3).HorizontalAlignment = xlCenter
Cells(9,4).Formula="'Serie 2"
Cells(9,4).Borders.LineStyle = xlLineStyleContinuous
Cells(9,4).HorizontalAlignment = xlCenter
Cells(10,2).Formula="=1"
Cells(10,3).Formula="=B10*B10"
Cells(10,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(10,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(10,3).HorizontalAlignment = xlCenter
Cells(10,4).Formula="=+C10-B10"
Cells(10,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(10,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(10,4).HorizontalAlignment = xlCenter
Cells(11,2).Formula="=1+B10"
Cells(11,3).Formula="=B11*B11"
Cells(11,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(11,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(11,3).HorizontalAlignment = xlCenter
Cells(11,4).Formula="=+C11-B11"
Cells(11,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(11,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(11,4).HorizontalAlignment = xlCenter
Cells(12,2).Formula="=1+B11"
Cells(12,3).Formula="=B12*B12"
Cells(12,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(12,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(12,3).HorizontalAlignment = xlCenter
Cells(12,4).Formula="=+C12-B12"
Cells(12,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(12,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(12,4).HorizontalAlignment = xlCenter
Cells(13,2).Formula="=1+B12"
Cells(13,3).Formula="=B13*B13"
Cells(13,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(13,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(13,3).HorizontalAlignment = xlCenter
Cells(13,4).Formula="=+C13-B13"
Cells(13,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(13,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(13,4).HorizontalAlignment = xlCenter
Cells(14,2).Formula="=1+B13"
Cells(14,3).Formula="=B14*B14"
Cells(14,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(14,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(14,3).HorizontalAlignment = xlCenter
Cells(14,4).Formula="=+C14-B14"
Cells(14,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(14,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(14,4).HorizontalAlignment = xlCenter
Cells(15,2).Formula="=1+B14"
Cells(15,3).Formula="=B15*B15"
Cells(15,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(15,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(15,3).HorizontalAlignment = xlCenter
Cells(15,4).Formula="=+C15-B15"
Cells(15,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(15,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(15,4).HorizontalAlignment = xlCenter
Cells(16,2).Formula="=1+B15"
Cells(16,3).Formula="=B16*B16"
Cells(16,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(16,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(16,3).HorizontalAlignment = xlCenter
Cells(16,4).Formula="=+C16-B16"
Cells(16,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(16,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(16,4).HorizontalAlignment = xlCenter
Cells(17,2).Formula="=1+B16"
Cells(17,3).Formula="=B17*B17"
Cells(17,3).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
Cells(17,3).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(17,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(17,3).HorizontalAlignment = xlCenter
Cells(17,4).Formula="=+C17-B17"
Cells(17,4).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
Cells(17,4).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
Cells(17,4).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
Cells(17,4).HorizontalAlignment = xlCenter
Cells(22,3).Formula="'Y axis label:"
Cells(22,4).Formula="'value"
Cells(23,3).Formula="'X axis label:"
Cells(23,4).Formula="'x data"
Set objchart = ActiveWorksheet.ChartObjects.Add (273,37,431,344)
objchart.Activate
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSerie
ActiveChart.SeriesCollection(1).XValues = Range("B10:B17")
ActiveChart.SeriesCollection(1).Name = "C9"
ActiveChart.SeriesCollection(1).Values = Range("C10:C17")
ActiveChart.SeriesCollection(2).Name = "D9"
ActiveChart.SeriesCollection(2).Values = Range("D10:D17")
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "A1"
ActiveChart.Axes(xlCategory).HasTitle = True
ActiveChart.Axes(xlCategory).AxisTitle.Text = "D23"
ActiveChart.Axes(xlValue   ).HasTitle = True
ActiveChart.Axes(xlValue   ).AxisTitle.Text = "D22"
Worksheets(1).Activate
End Sub
