Guest User

Untitled

a guest
Mar 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. A B C D E A C E
  2. - - - - - Sometimes, there - - -
  3. 1 4 7 1 4 are less data, 1 7 4
  4. 2 5 8 2 5 like --> 2 8 5
  5. 3 6 9 3 6 3 9 6
  6.  
  7. Dim findA As Range
  8. Set findA = Range("A1:G1").Find(What:="A", _
  9. lookat:=xlWhole, MatchCase:=False, SearchFormat:=False)
  10. If Not (findA Is Nothing) Then
  11. findA = findA.Column
  12. End If
  13.  
  14. v(0) = Array(4, 21, 38, 55, 72) 'graphs' row-location
  15. v(1) = Array(findA, findB, findB, findA, findB) 'xaxis column
  16. v(2) = Array(findC, findC, findA, findD, findE) 'yaxis column
  17. v(3) = Array("A", "B", "B", "A", "B") 'xaxis title
  18. v(4) = Array("C", "C", "A", "D", "E") 'yaxis title
  19.  
  20. For i = 0 To 4 Step 1
  21. Set c = ActiveSheet.Shapes.AddChart.Chart
  22. With c
  23. .Parent.Top = Cells(v(0)(i), 8).Top
  24. .Parent.Left = Cells(v(0)(i), 8).Left
  25. .ChartType = xlXYScatterSmoothNoMarkers
  26. Do While .SeriesCollection.Count > 0
  27. .SeriesCollection(1).Delete
  28. Loop
  29. .SeriesCollection.NewSeries
  30. .SeriesCollection(1).Name = Data
  31. -->.SeriesCollection(1).XValues = Range(Cells(3, v(1)(i)), Cells(5, v(1)(m)))
  32. -->.SeriesCollection(1).Values = Range(Cells(3, v(2)(i)), Cells(5, v(2)(m)))
  33. .Legend.Delete
  34. .ChartTitle.Delete
  35. .Axes(xlCategory, xlPrimary).HasTitle = True 'x-axis
  36. .Axes(xlCategory, xlPrimary).AxisTitle.Caption = v(3)(i)
  37. .Axes(xlValue, xlPrimary).HasTitle = True 'y-axis
  38. .Axes(xlValue, xlPrimary).AxisTitle.Caption = v(4)(i)
  39. .ChartArea.Border.LineStyle = xlNone
  40. .PlotArea.Border.LineStyle = msoLineSingle
  41. End With
  42. Next
Add Comment
Please, Sign In to add comment