<body id="************" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody></body>
<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody>
I have a loop creating 10 charts using Range Offset to increment 2 columns at a time. The issue i have is the placement of each chart, currently they're stacking 10 charts on top of each other. Is there a way so each time the loop runs the chart position changes each time. Below is the code i currently have. |
<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody>
I have a loop creating 10 charts using Range Offset to increment 2 columns at a time. The issue i have is the placement of each chart, currently they're stacking 10 charts on top of each other. Is there a way so each time the loop runs the chart position changes each time. Below is the code i currently have. <code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">Sub charts() 'Set up the variables. Dim rng As Range 'Use the InputBox dialog to set the range for MyFunction Set rng = Application.InputBox("Select a range", "Obtain Range Object", Type:=8) 'Call MyFunction ActiveCell.Value = MyFunction(rng) End Sub Function MyFunction(rng As Range) As Double For i = 1 To 20 Step 2 Endrow = Range("A1").End(xlUp).Row - 1 Set Range1 = rng.Offset(Endrow, i + 1) Sheets("All team charts").Select MyFunction = ActiveSheet.Shapes.AddChart.Select ActiveChart.ChartType = xlLineMarkers ActiveChart.HasLegend = False ActiveChart.HasTitle = True ActiveChart.ChartTitle.Text = "Team 1" ActiveChart.Parent.Name = "Team 1" ActiveChart.SetSourceData Source:=Range1 With ActiveChart.Parent .height = 200 ' resize .width = 350 ' resize .top = 20 ' reposition .left = 20 ' reposition End With Next i End Function</code> |
<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody>