sh.Shapes(1).Top = sh.Cells(1, 1).Top
sh.Shapes(1).Left = sh.Cells(1, 1).Left
sh.Shapes(1).Width = sh.Cells(1, 15).Left
sh.Shapes(1).Height = sh.Cells(38, 1).Top
Charts.Add
sh.Shapes(1).Top = sh.Cells(1, 1).Top
sh.Shapes(1).Left = sh.Cells(1, 1).Left
sh.Shapes(1).Width = sh.Cells(1, 11).Left
sh.Shapes(1).Height = sh.Cells(11, 1).Top
Charts.Add
sh.Shapes(2).Top = sh.Cells(12, 1).Top
sh.Shapes(2).Left = sh.Shapes(1).Left
sh.Shapes(2).Width = sh.Shapes(1).Width
sh.Shapes(2).Height = sh.Shapes(1).Height
Charts.Add
sh.Shapes(3).Top = sh.Cells(22, 1).Top
sh.Shapes(3).Left = sh.Shapes(1).Left
sh.Shapes(3).Width = sh.Shapes(1).Width
sh.Shapes(3).Height = sh.Shapes(1).Height
Sub q1()
Dim sh As Worksheet
Set sh = ActiveWorkbook.ActiveSheet
With Charts.Add
.Location Where:=xlLocationAsObject, Name:=sh.Name
End With
sh.Shapes(1).Top = sh.Cells(1, 1).Top
sh.Shapes(1).Left = sh.Cells(1, 1).Left
sh.Shapes(1).Width = sh.Cells(1, 11).Left
sh.Shapes(1).Height = sh.Cells(11, 1).Top
With Charts.Add
.Location Where:=xlLocationAsObject, Name:=sh.Name
End With
sh.Shapes(2).Top = sh.Cells(12, 1).Top
sh.Shapes(2).Left = sh.Shapes(1).Left
sh.Shapes(2).Width = sh.Shapes(1).Width
sh.Shapes(2).Height = sh.Shapes(1).Height
With Charts.Add
.Location Where:=xlLocationAsObject, Name:=sh.Name
End With
sh.Shapes(3).Top = sh.Cells(23, 1).Top
sh.Shapes(3).Left = sh.Shapes(1).Left
sh.Shapes(3).Width = sh.Shapes(1).Width
sh.Shapes(3).Height = sh.Shapes(1).Height
End Sub
Sub Ìàêðîñ1()
k = 0
For i = 1 To 3
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Values = "='traffic inc'!R2C2:R13C2"
ActiveChart.SeriesCollection(2).Values = "='traffic inc'!R3C3:R13C3"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Ëèñò3"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "3"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.PlotArea.Select
ActiveChart.Axes(xlValue).MajorGridlines.Select
ActiveChart.PlotArea.Select
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"Ãðàôèê|ãèñòîãðàììà 2"
ActiveChart.Parent.Height = 200
ActiveChart.Parent.Left = 10
ActiveChart.Parent.Top = 10 * i + k
k = k + 200
Next
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 82