ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

VBA µe¹Ï¤è¦¡½Ð¯q?????

VBA µe¹Ï¤è¦¡½Ð¯q?????

½Ð±Ð¦U¦ì¤j¤j:
§Ú¦³5­Ó¥H¤Wªºsheets¸ê®Æ,·Q­n¦Û°Ê§ì¨ú¨ä¤¤columnªº¸ê®Æ¨Ãµe¦¨´²¥¬¹Ï(¸ê®Æsheet¤£¤@©w,¦³®É¶W­Ó10­Ósheets .....½Ð°Ý¥H¤Uµ{¦¡·|¤£·|¤Ó±`¦³¥i¥H²µuÂI¶Ü?
PS:¦pªG§Ú­nµe²Ä¤G±i¹Ï¦b¦P¤@±isheet¤º,À³¸Ó«ç»ò¼g(¸ê®Æ¤]¬O®Ú¾Ú¤§«eªºsheet ¦ý¤£¦Pcolumn)
¥H¤U¬O²Ä¤@±i¹Ïªºcode:
  1. Sub ALL_PLOT()

  2. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  3. '                                                                             '
  4. '                               Plot Create                                  '
  5. '                                                                             '
  6. '                                                                             '
  7. ' ''''''''''''''''''''''CHART(1) Ave.Ave. G.R. '''''''''''''''''''''''''''''''

  8. ''''''''''''''''''''''''''Chart(1) Ave. G.R. / HSP ADD''''''''''''''''''''''''
  9.   Sheets("R2R_analysis").Select
  10.   ActiveSheet.Shapes.AddChart.Select
  11.     ActiveChart.ChartType = xlXYScatter

  12.    Dim aSh As Worksheet
  13.     Application.ScreenUpdating = False
  14.     For Each aSh In Worksheets
  15.     If aSh.Name = "¤u§@ªí1 (2)" Then
  16.     Call polt_1
  17.     ElseIf aSh.Name = "¤u§@ªí1 (3)" Then
  18.     Call polt_2
  19.     ElseIf aSh.Name = "¤u§@ªí1 (4)" Then
  20.     Call polt_3
  21.     ElseIf aSh.Name = "¤u§@ªí1 (5)" Then
  22.     Call polt_4
  23.     ElseIf aSh.Name = "¤u§@ªí1 (6)" Then
  24.     Call polt_5
  25.    
  26.      ElseIf aSh.Name = "¤u§@ªí1 (7)" Then
  27.     Call polt_6
  28.    
  29.      ElseIf aSh.Name = "¤u§@ªí1 (8)" Then
  30.     Call polt_7
  31.    
  32.      ElseIf aSh.Name = "¤u§@ªí1 (9)" Then
  33.     Call polt_8
  34.      ElseIf aSh.Name = "¤u§@ªí1 (10)" Then
  35.     Call polt_9
  36.    
  37.    
  38.     ElseIf aSh.Name = "¤u§@ªí1 (11)" Then
  39.     Call polt_10
  40.     ElseIf aSh.Name = "¤u§@ªí1 (12)" Then
  41.       Call polt_11
  42.       
  43.    End If
  44.         
  45.         
  46.   Next
  47.     Application.ScreenUpdating = True
  48.       
  49. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  50.   ActiveChart.ApplyLayout (4)
  51.    
  52. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  53.    
  54. Dim xRg As Range
  55.      Dim xChart As ChartObject
  56.     Set xRg = Range("A20:J50")
  57.   Set xChart = ActiveSheet.ChartObjects(1)
  58.    With xChart
  59.   .Top = xRg(1).Top
  60. .Left = xRg(1).Left
  61. .Width = xRg.Width
  62. .Height = xRg.Height
  63.    End With
  64. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  65.    
  66.    ActiveChart.SetElement (msoElementChartTitleAboveChart)
  67.     Selection.Caption = "R2R_Ave.G.R."
  68.     ActiveChart.SetElement (msoElementPrimaryValueAxisTitleRotated)
  69.     Selection.Caption = "G.R.(mm/hr)"
  70.     ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
  71.     Selection.Caption = "Length(mm)"
  72.    
  73.     ActiveSheet.ChartObjects(1).Activate
  74.     ActiveChart.Axes(xlCategory).Select
  75.     ActiveChart.Axes(xlCategory).MinimumScale = 0
  76.     ActiveChart.Axes(xlCategory).MaximumScale = 1100
  77.     ActiveChart.Axes(xlCategory).MajorUnit = 100
  78.     ActiveChart.Axes(xlCategory).MinorUnit = 50
  79.     ActiveChart.Axes(xlCategory).CrossesAt = 0
  80.     ActiveChart.Axes(xlValue).CrossesAt = 0

  81.     ActiveChart.SetElement (msoElementPrimaryValueGridLinesMajor)
  82.     ActiveChart.SetElement (msoElementPrimaryCategoryGridLinesMajor)
  83.   

  84.     Application.ScreenUpdating = True
  85.   
  86.   
  87.   

  88.   
  89. End Sub
  90. Sub polt_1()
  91.    
  92.     ActiveChart.SeriesCollection.NewSeries
  93.     ActiveChart.SeriesCollection(1).Name = Sheets("¤u§@ªí1 (2)").Range("U1")
  94.     ActiveChart.SeriesCollection(1).XValues = "='¤u§@ªí1 (2)'!$A$2:$A$20000"
  95.     ActiveChart.SeriesCollection(1).Values = "='¤u§@ªí1 (2)'!$D$2:$D$20000"
  96.    
  97. End Sub
  98. Sub polt_2()
  99.     ActiveChart.SeriesCollection.NewSeries
  100.     ActiveChart.SeriesCollection(2).Name = Sheets("¤u§@ªí1 (3)").Range("U1")
  101.     ActiveChart.SeriesCollection(2).XValues = "='¤u§@ªí1 (3)'!$A$2:$A$20000"
  102.     ActiveChart.SeriesCollection(2).Values = "='¤u§@ªí1 (3)'!$D$2:$D$20000"
  103.    
  104.   End Sub

  105. Sub polt_3()
  106.     ActiveChart.SeriesCollection.NewSeries
  107.     ActiveChart.SeriesCollection(3).Name = Sheets("¤u§@ªí1 (4)").Range("U1")
  108.     ActiveChart.SeriesCollection(3).XValues = "='¤u§@ªí1 (4)'!$A$2:$A$20000"
  109.     ActiveChart.SeriesCollection(3).Values = "='¤u§@ªí1 (4)'!$D$2:$D$20000"
  110.    
  111.   End Sub

  112. Sub polt_4()
  113.     ActiveChart.SeriesCollection.NewSeries
  114.     ActiveChart.SeriesCollection(4).Name = Sheets("¤u§@ªí1 (5)").Range("U1")
  115.     ActiveChart.SeriesCollection(4).XValues = "='¤u§@ªí1 (5)'!$A$2:$A$20000"
  116.     ActiveChart.SeriesCollection(4).Values = "='¤u§@ªí1 (5)'!$D$2:$D$20000"
  117.    
  118.   End Sub

  119. Sub polt_5()
  120.     ActiveChart.SeriesCollection.NewSeries
  121.     ActiveChart.SeriesCollection(5).Name = Sheets("¤u§@ªí1 (6)").Range("U1")
  122.     ActiveChart.SeriesCollection(5).XValues = "='¤u§@ªí1 (6)'!$A$2:$A$20000"
  123.     ActiveChart.SeriesCollection(5).Values = "='¤u§@ªí1 (6)'!$D$2:$D$20000"
  124.    
  125.   End Sub


  126. Sub polt_6()
  127.     ActiveChart.SeriesCollection.NewSeries
  128.     ActiveChart.SeriesCollection(6).Name = Sheets("¤u§@ªí1 (7)").Range("U1")
  129.     ActiveChart.SeriesCollection(6).XValues = "='¤u§@ªí1 (7)'!$A$2:$A$20000"
  130.     ActiveChart.SeriesCollection(6).Values = "='¤u§@ªí1 (7)'!$D$2:$D$20000"
  131.    
  132.   End Sub

  133. Sub polt_7()
  134.     ActiveChart.SeriesCollection.NewSeries
  135.     ActiveChart.SeriesCollection(7).Name = Sheets("¤u§@ªí1 (8)").Range("U1")
  136.     ActiveChart.SeriesCollection(7).XValues = "='¤u§@ªí1 (8)'!$A$2:$A$20000"
  137.     ActiveChart.SeriesCollection(7).Values = "='¤u§@ªí1 (8)'!$D$2:$D$20000"
  138.    
  139.   End Sub
  140.   Sub polt_8()
  141.     ActiveChart.SeriesCollection.NewSeries
  142.     ActiveChart.SeriesCollection(8).Name = Sheets("¤u§@ªí1 (9)").Range("U1")
  143.     ActiveChart.SeriesCollection(8).XValues = "='¤u§@ªí1 (9)'!$A$2:$A$20000"
  144.     ActiveChart.SeriesCollection(8).Values = "='¤u§@ªí1 (9)'!$D$2:$D$20000"
  145.    
  146.   End Sub
  147.    Sub polt_9()
  148.     ActiveChart.SeriesCollection.NewSeries
  149.     ActiveChart.SeriesCollection(9).Name = Sheets("¤u§@ªí1 (10)").Range("U1")
  150.     ActiveChart.SeriesCollection(9).XValues = "='¤u§@ªí1 (10)'!$A$2:$A$20000"
  151.     ActiveChart.SeriesCollection(9).Values = "='¤u§@ªí1 (10)'!$D$2:$D$20000"
  152.    
  153.   End Sub
  154.    Sub polt_10()
  155.     ActiveChart.SeriesCollection.NewSeries
  156.     ActiveChart.SeriesCollection(10).Name = Sheets("¤u§@ªí1 (11)").Range("U1")
  157.     ActiveChart.SeriesCollection(10).XValues = "='¤u§@ªí1 (11)'!$A$2:$A$20000"
  158.     ActiveChart.SeriesCollection(10).Values = "='¤u§@ªí1 (11)'!$D$2:$D$20000"
  159.     End Sub
  160. Sub polt_11()
  161. ActiveChart.SeriesCollection.NewSeries
  162.     ActiveChart.SeriesCollection(11).Name = Sheets("¤u§@ªí1 (12)").Range("U1")
  163.     ActiveChart.SeriesCollection(11).XValues = "='¤u§@ªí1 (12)'!$A$2:$A$20000"
  164.     ActiveChart.SeriesCollection(11).Values = "='¤u§@ªí1 (12)'!$D$2:$D$20000"
  165. End Sub
½Æ»s¥N½X
Tks
Ian

¦^´_ 1# iverson105

¿@ÁY³o¼Ë,¸Õ¸Õ¬Ý
Sub ALL_PLOT()
Dim x As Integer
Sheets("R2R_analysis").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatter
Application.ScreenUpdating = False
For x = 2 To Worksheets.Count
   ActiveChart.SeriesCollection.NewSeries
   ActiveChart.SeriesCollection(x - 1).Name = Sheets("¤u§@ªí1 (" & x & ")").Range("U1")
   ActiveChart.SeriesCollection(x - 1).XValues = Sheets("¤u§@ªí1 (" & x & ")").Range("A2:A20000")
   ActiveChart.SeriesCollection(x - 1).Values = Sheets("¤u§@ªí1 (" & x & ")").Range("D2:D20000")
Next
Application.ScreenUpdating = True

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ActiveChart.ApplyLayout (4)

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim xRg As Range
Dim xChart As ChartObject
Set xRg = Range("A20:J50")
Set xChart = ActiveSheet.ChartObjects(1)
With xChart
   .Top = xRg(1).Top
   .Left = xRg(1).Left
   .Width = xRg.Width
   .Height = xRg.Height
End With

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ActiveChart.SetElement (msoElementChartTitleAboveChart)
Selection.Caption = "R2R_Ave.G.R."
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleRotated)
Selection.Caption = "G.R.(mm/hr)"
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
Selection.Caption = "Length(mm)"
ActiveSheet.ChartObjects(1).Activate
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).MinimumScale = 0
ActiveChart.Axes(xlCategory).MaximumScale = 1100
ActiveChart.Axes(xlCategory).MajorUnit = 100
ActiveChart.Axes(xlCategory).MinorUnit = 50
ActiveChart.Axes(xlCategory).CrossesAt = 0
ActiveChart.Axes(xlValue).CrossesAt = 0
ActiveChart.SetElement (msoElementPrimaryValueGridLinesMajor)
ActiveChart.SetElement (msoElementPrimaryCategoryGridLinesMajor)
Application.ScreenUpdating = True
End Sub

TOP

¦^´_ 2# jcchiang
²Ä¤G­Ó°ÝÃD:¦pªG§Ú­nµe²Ä¤G±i¹Ï¦b¦P¤@±isheet¤º,À³¸Ó«ç»ò¼g(¸ê®Æ¤]¬O®Ú¾Ú¤§«eªºsheet ¦ý¤£¦Pcolumn)
¦]¬°¤£½T©w·|µe´X±i¹Ï,©Ò¥Hµ{¦¡·|¥ý¸ß°Ý­nµe´X¦¸(¦pªG¥u·|µe2±i´N±Ny = Application.InputBox("µe¹Ï¦¸¼Æ", "")²¾°£,For z = 1 To y§ï¬°For z = 1 To 2)
¥t¥~²Ä¤G±i¥H«áªº¹ÏColumn¤£ª¾¹D·|¦b­þ¸Ì,¥ý·í§@¦A²Ä¤@±i¹ÏColumn©¹¥kÂ\©ñ,¦pªG¦ì¸m®t²§¸û¦h´N­n¦A­×§ï

Sub ALL_PLOT1()
Dim x, y, z As Integer
y = Application.InputBox("µe¹Ï¦¸¼Æ", "")
For z = 1 To y
Sheets("R2R_analysis").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatter
Application.ScreenUpdating = False
For x = 2 To Worksheets.Count
   ActiveChart.SeriesCollection.NewSeries
   ActiveChart.SeriesCollection(x - 1).Name = Sheets("¤u§@ªí1 (" & x & ")").Range("U1").Offset(0, (z - 1))
   ActiveChart.SeriesCollection(x - 1).XValues = Sheets("¤u§@ªí1 (" & x & ")").Range("A2:A20000").Offset(0, (z - 1))
   ActiveChart.SeriesCollection(x - 1).Values = Sheets("¤u§@ªí1 (" & x & ")").Range("D2:D20000").Offset(0, (z - 1))
Next
Application.ScreenUpdating = True

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ActiveChart.ApplyLayout (4)

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim xRg As Range
Dim xChart As ChartObject
Set xRg = Range("A20:J50")
Set xChart = ActiveSheet.ChartObjects(z)
With xChart
   .Top = xRg(z).Top
   .Left = xRg(z).Left
   .Width = xRg.Width
   .Height = xRg.Height
End With

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ActiveChart.SetElement (msoElementChartTitleAboveChart)
Selection.Caption = "R2R_Ave.G.R." & z
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleRotated)
Selection.Caption = "G.R.(mm/hr)"
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
Selection.Caption = "Length(mm)"
ActiveSheet.ChartObjects(z).Activate
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).MinimumScale = 0
ActiveChart.Axes(xlCategory).MaximumScale = 1100
ActiveChart.Axes(xlCategory).MajorUnit = 100
ActiveChart.Axes(xlCategory).MinorUnit = 50
ActiveChart.Axes(xlCategory).CrossesAt = 0
ActiveChart.Axes(xlValue).CrossesAt = 0
ActiveChart.SetElement (msoElementPrimaryValueGridLinesMajor)
ActiveChart.SetElement (msoElementPrimaryCategoryGridLinesMajor)
Application.ScreenUpdating = True
Next
End Sub

TOP

¦^´_ 2# jcchiang

·PÁ¤j¤jªº¦^ÂÐ
¦ý¦b¶]ªº®É­Ô¥X²{¿ù»~????????
¦A³Â·Ð«ü±Ð!

ÁÂÁÂ
  1. Sub ALL_PLOT_TEST()
  2. Dim x As Integer
  3. Sheets("R2R_analysis").Select
  4. ActiveSheet.Shapes.AddChart.Select
  5. ActiveChart.ChartType = xlXYScatter
  6. Application.ScreenUpdating = False
  7. For x = 2 To Worksheets.Count
  8.    ActiveChart.SeriesCollection.NewSeries
  9.    ActiveChart.SeriesCollection(x - 1).Name = Sheets("¤u§@ªí1 (" & x & ")").Range("U1")   .....................................................(½Ð°Ý³o¬q¥X¿ù»~(°}¦C¯Á¤Þ ¶W¥X½d³ò) ­n¦p¦ó­×¥¿
  10.    ActiveChart.SeriesCollection(x - 1).XValues = Sheets("¤u§@ªí1 (" & x & ")").Range("A2:A20000")
  11.    ActiveChart.SeriesCollection(x - 1).Values = Sheets("¤u§@ªí1 (" & x & ")").Range("D2:D20000")
  12. Next
  13. Application.ScreenUpdating = True
½Æ»s¥N½X
Ian

TOP

¦^´_ 4# iverson105

³o¬q¬O¦b§ì¤u§@ªí¸ê®Æ¨ì¹Ïªí¸Ì
§Aªº¤u§@ªí¦WºÙ¬O"¤u§@ªí1 (2)",¤u§@ªí1 (3)"...........¥H¤W¶Ü??
,¥i¥H¤W¶Ç§AªºÀɮ׶Ü??³o¼Ë¤ñ¸û¯àª¾¹D­ì¦]

TOP

·PÁ¤j¤jªº«ü±Ð
·Q¦b½Ð°Ý¤@¤U
¥H¤Uªºcode
1.¥i¥H§ï¦¨¹Ïªí©ñ¸mªº¦ì¸m¬O¨Ì§Ú¥u¬Oªº¦ì¸m©T©w¶Ü(ex:Plot1 ¦b A20:J50  '  plot2¦bL20:U50........¥H¦¹Ãþ±À)
2.ÁÙ¦³§¤¼Ð¶b¥i¦Û¤v¥ý¼g¦bcode¤¤¶Ü? ¦]¬°¨C¤@±i¹Ïªº®y¼Ð¶b©ú¦¨¤£¤@¼Ë

·PÁÂ
  1. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  2. Dim xRg As Range
  3. Dim xChart As ChartObject
  4. Set xRg = Range("A20:J50")..........................................................................................(°ÝÃD1)
  5. Set xChart = ActiveSheet.ChartObjects(z)
  6. With xChart
  7.    .Top = xRg(z).Top
  8.    .Left = xRg(z).Left
  9.    .Width = xRg.Width
  10.    .Height = xRg.Height
  11. End With

  12. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  13. ActiveChart.SetElement (msoElementChartTitleAboveChart)
  14. Selection.Caption = "R2R_Ave.G.R." & z...........................................................................................(°ÝÃD2)
  15. ActiveChart.SetElement (msoElementPrimaryValueAxisTitleRotated)
  16. Selection.Caption = "G.R.(mm/hr)"..........................................................................................(°ÝÃD2)
  17. ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
  18. Selection.Caption = "Length(mm)"
½Æ»s¥N½X
¦^´_ 3# jcchiang
Ian

TOP

¦^´_ 5# jcchiang

¦n³á!  ±ßÂI¶Ç
(¤W¯Z¤¤ ¤u§@¹q¸£¶Ç¤£¥X¥h)   

·PÁÂ
Ian

TOP

¦^´_ 6# iverson105

³o¼Ë¥¼ª¾ªºÅܼƤӦh¤F
1.·|µe´X±i¹Ï¤£ª¾
2.¦WºÙ¤S­n¤£¤@¼Ë
3.¨C±i¹Ï®y¼Ð¤S­n¤£¤@¼Ë
°£«D¬O¥ý±N¹Ïªí³]©w¦n­nªº¦WºÙ¸ò®y¼Ð¦A±N¸ê®Æ©ß¶i¥h,
¦pªG¬ÛÃö¸ê®Æ³£¤£©úªº±¡ªp¤U,¤p§Ì¤~²¨¾Ç²L¥i¯à¼g¤£¥X¨Ó,´N­n½Ð¯¸¤Wªº¤j¯««ü¾ÉÅo

TOP

¦^´_ 6# iverson105
¥ý¿é¤J©Ò»Ý¸ê®Æ«á,¦A±N¬ÛÃö¸ê®Æ±a¤J¹Ïªí
¦pªG¦³¤£°÷ªº½Ð¨Ì¦¹¤è¦¡¼W¥[­nªº¸ê®Æ

Sub ALL_PLOT2()
Dim x, y, z, R As Integer
Dim CName(10, 10)
R = 0

Do While y = ""                                          '¨¾¤î¸ê®Æ¬°ªÅ¥Õ
   y = Application.InputBox("µe¹Ï¦¸¼Æ", "", 1, 350, 150) '¿é¤J­nµe´X±i¹Ï,¹w³]¬°1±i
   If y = "" Then MsgBox "µe¹Ï¦¸¼Æ¤£±o¬°ªÅ¥Õ!!"
Loop
'----------------------------------¿é¤J¦U¹Ïªí¬ÛÃö¸ê®Æ(©Ò»Ý¸ê®Æ¦Û¦æ¼W¥[)-----------
For z = 1 To y
Do While CName(z, 0) = ""
   CName(z, 0) = Application.InputBox("²Ä" & z & "¹Ï¦W", "", "R2R_Ave.G.R." & z, 350, 150) '¿é¤J¹Ïªí¦WºÙ,¹w³]¬°R2R_Ave.G.R.1
   If CName(z, 0) = "" Then MsgBox "½Ð¿é¤J¹Ï¦W!!"
Loop
Do While CName(z, 1) = ""
   CName(z, 1) = Application.InputBox("²Ä" & z & "¹ÏªºMinimumScale", "", "0", 350, 150)    '¿é¤Jx¶b³Ì¤p®y¼Ð,¹w³]¬°0
   If CName(z, 1) = "" Then MsgBox "MinimumScale¤£±o¬°ªÅ¥Õ!!"
Loop
Do While CName(z, 2) = ""
   CName(z, 2) = Application.InputBox("²Ä" & z & "¹ÏªºMaximumScale", "", "1000", 350, 150) '¿é¤Jx¶b³Ì¤j®y¼Ð,¹w³]¬°0
   If CName(z, 2) = "" Then MsgBox "MaximumScale¤£±o¬°ªÅ¥Õ!!"
Loop
Next

'---------------------------------------------------------------
For z = 1 To y
Sheets("R2R_analysis").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatter
Application.ScreenUpdating = False
For x = 2 To Worksheets.Count
   ActiveChart.SeriesCollection.NewSeries
   ActiveChart.SeriesCollection(x - 1).Name = Sheets("¤u§@ªí1 (" & x & ")").Range("U1").Offset(0, (z - 1))
   ActiveChart.SeriesCollection(x - 1).XValues = Sheets("¤u§@ªí1 (" & x & ")").Range("A2:A20000").Offset(0, (z - 1))
   ActiveChart.SeriesCollection(x - 1).Values = Sheets("¤u§@ªí1 (" & x & ")").Range("D2:D20000").Offset(0, (z - 1))
Next
Application.ScreenUpdating = True

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ActiveChart.ApplyLayout (4)

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim xRg As Range
Dim xChart As ChartObject
Set xRg = Range("A20:J50").Offset(0, R)
Set xChart = ActiveSheet.ChartObjects(z)
With xChart
   .Top = xRg(z).Top
   .Left = xRg(z).Left
   .Width = xRg.Width
   .Height = xRg.Height
End With

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ActiveChart.SetElement (msoElementChartTitleAboveChart)
Selection.Caption = CName(z, 0)
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleRotated)
Selection.Caption = "G.R.(mm/hr)"
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
Selection.Caption = "Length(mm)"
ActiveSheet.ChartObjects(z).Activate
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).MinimumScale = CName(z, 1)
ActiveChart.Axes(xlCategory).MaximumScale = CName(z, 2)
ActiveChart.Axes(xlCategory).MajorUnit = 100
ActiveChart.Axes(xlCategory).MinorUnit = 50
ActiveChart.Axes(xlCategory).CrossesAt = 0
ActiveChart.Axes(xlValue).CrossesAt = 0
ActiveChart.SetElement (msoElementPrimaryValueGridLinesMajor)
ActiveChart.SetElement (msoElementPrimaryCategoryGridLinesMajor)
Application.ScreenUpdating = True
R = R + 10 '¨C±i¹Ïªí¦ì¸m¶¡¹j
Next
End Sub

TOP

¦^´_ 9# jcchiang


    ·PÁ¤j¤jªº¦^ÂÐ ,§Ú¦A¸Õ¤@¤U,·PÀ³¤£ºÉ


ÁÂÁÂ
Ian

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD