Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A B C D E A C E
- - - - - - Sometimes, there - - -
- 1 4 7 1 4 are less data, 1 7 4
- 2 5 8 2 5 like --> 2 8 5
- 3 6 9 3 6 3 9 6
- Dim findA As Range
- Set findA = Range("A1:G1").Find(What:="A", _
- lookat:=xlWhole, MatchCase:=False, SearchFormat:=False)
- If Not (findA Is Nothing) Then
- findA = findA.Column
- End If
- v(0) = Array(4, 21, 38, 55, 72) 'graphs' row-location
- v(1) = Array(findA, findB, findB, findA, findB) 'xaxis column
- v(2) = Array(findC, findC, findA, findD, findE) 'yaxis column
- v(3) = Array("A", "B", "B", "A", "B") 'xaxis title
- v(4) = Array("C", "C", "A", "D", "E") 'yaxis title
- For i = 0 To 4 Step 1
- Set c = ActiveSheet.Shapes.AddChart.Chart
- With c
- .Parent.Top = Cells(v(0)(i), 8).Top
- .Parent.Left = Cells(v(0)(i), 8).Left
- .ChartType = xlXYScatterSmoothNoMarkers
- Do While .SeriesCollection.Count > 0
- .SeriesCollection(1).Delete
- Loop
- .SeriesCollection.NewSeries
- .SeriesCollection(1).Name = Data
- -->.SeriesCollection(1).XValues = Range(Cells(3, v(1)(i)), Cells(5, v(1)(m)))
- -->.SeriesCollection(1).Values = Range(Cells(3, v(2)(i)), Cells(5, v(2)(m)))
- .Legend.Delete
- .ChartTitle.Delete
- .Axes(xlCategory, xlPrimary).HasTitle = True 'x-axis
- .Axes(xlCategory, xlPrimary).AxisTitle.Caption = v(3)(i)
- .Axes(xlValue, xlPrimary).HasTitle = True 'y-axis
- .Axes(xlValue, xlPrimary).AxisTitle.Caption = v(4)(i)
- .ChartArea.Border.LineStyle = xlNone
- .PlotArea.Border.LineStyle = msoLineSingle
- End With
- Next
Add Comment
Please, Sign In to add comment