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

½Ð¦U¦ì¤j¤jÀ°¦£­×§ï«Ø¥ß®r¤J¹Ïªí¿ù»~»yªk

¦^´_ 1# lamihsuen
¶K¤W GBKEE «ü¾É«e½ú´¿¸gµ¹§Úªº½d¨Ò¡A³ö¨Ñ©p°Ñ¦Ò¡A§Æ±æ¹ï©p·|¦³¹ê½èªºÀ°§U¡C
¤S¡B©p¥´¿ù¦r¤F .RANRE -> .RANGE¡C (ºâ²Ê¤ß§a¡I:o )
  1. Private Sub »s¹Ï()
  2.     Dim xR As Range, Xi As Integer, i As Integer, ¹Ï¦â()

  3.     ¹Ï¦â = Array(4, 6, 8, 10)

  4.     ActiveSheet.ChartObjects.Delete     '§R°£¥þ³¡¹Ïªí

  5.     Set xR = Range("F1")    '§Q¥ÎxRªº¦ì¸m ³]¤U¹Ïªíªº¦ì¸m
  6.     '¥[¤J·s¹Ïªí  ¶·«ü©w 1¥kÃä¦ì¸m, 2°ª«×¦ì¸m, 3¹ÏªíªºWidth, 4¹ÏªíªºHeight

  7.     With ChartObjects.Add(xR.Left, xR.Top, xR.Resize(, 10).Width, xR.Resize(10).Height).Chart
  8.     .ChartType = 51  ' xlLineMarkers    '§é½u¹Ï         '¹Ïªí ¦¡¼Ë
  9.         With ActiveSheet.Range("A2").CurrentRegion
  10.             Set xR = Union(.Columns(1), .Columns(3), .Columns(5))
  11.             '¸ê®Æ ½d³òªº 1,3,5 Ä欰¹Ïªí¸ê®Æ  :²Ä1Äæ ¬°x¶bªº¼Æ­È
  12.         End With
  13.         .SetSourceData Source:=xR, PlotBy:=xlColumns
  14.         '¹Ïªí¸ê®Æ¨Ó·½ : xR  ¸ê®Æ¦¡¼Ë: Äæ
  15.                      
  16.         .HasTitle = True              'Åã¥Ü ¹Ïªí¼ÐÃD
  17.         .ChartTitle.Characters.Text = ActiveSheet.Name    'HasTitle = False ·|¦³¿ù»~
  18.         .HasAxis(xlCategory, xlPrimary) = False           '¤£Åã¥Ü X¶b®y¼Ð
  19.                
  20.         'HasLegend ¹Ï¨Ò
  21.         .HasLegend = False             ' ¨ú®ø Åã¥Ü ¹Ï¨Ò
  22.         '  .Legend.Position = xlTop           'Åã¥Ü ¹Ï¨Ò¦ì¸m
  23.         ' .Axes(xlCategory).TickLabels.NumberFormatLocal = "m/d;@"    ' Axes(xlCategory) X®y¼Ð¶b
  24.         ' ** ¤W¤G¦¡ ¶·  Åã¥Ü¹Ï¨Ò ->  .HasLegend = True
  25.                
  26.         '.SeriesCollection(1).AxisGroup = 2           '·s¼W Y®y¼Ð¶b °Æ®y¼Ð¶b
  27.         '  .SeriesCollection(3)).Delete     '§R°£²Ä3¼Æ¦C¸ê®Æ
  28.         With .Axes(xlValue)      'y¶b®æ½u
  29.             .HasMajorGridlines = 0   '¨ú®ø ¥D®æ½u
  30.             .HasMinorGridlines = 0   '¨ú®ø °Æ®æ½u
  31.         End With
  32.         '¥H¤U¤@¨Çµ{¦¡½X §A¥i¥Î¿ý»s±oª¾
  33.         With .ChartArea             '¹Ïªíªº¹Ïªí°Ï
  34.             .Border.Weight = 1
  35.             .Border.LineStyle = -1
  36.             .Fill.OneColorGradient Style:=msoGradientHorizontal, Variant:=3, Degree:=0.231372549019608
  37.             .Fill.Visible = True
  38.             .Fill.ForeColor.SchemeColor = ¹Ï¦â(0)
  39.         End With
  40.         With .PlotArea              '¹Ïªíªº ø¹Ï°Ï
  41.             .Fill.OneColorGradient Style:=msoGradientHorizontal, Variant:=1, _
  42.             Degree:=0.231372549019608
  43.             .Fill.Visible = True
  44.             .Fill.ForeColor.SchemeColor = ¹Ï¦â(0)
  45.             With .Border
  46.             .ColorIndex = 16
  47.             .Weight = xlThin
  48.             .LineStyle = xlContinuous
  49.             End With
  50.         End With
  51.         For i = 1 To .SeriesCollection.Count
  52.             With .SeriesCollection(i)   '¼Æ¦C
  53.                 '  .XValues = ""       '<-¬°x¶bªº¼Æ­È   ¥i¦b¦¹¨ú®ø
  54.                 With .Border
  55.                 .ColorIndex = ¹Ï¦â(i)
  56.                 .Weight = xlMedium
  57.                 .LineStyle = xlContinuous
  58.                 End With
  59.                 '¥H¤UÄÝ©Ê ¥u¾A¦X §é½u¹Ï
  60.                 ' .MarkerBackgroundColorIndex = xlAutomatic
  61.                 '.MarkerForegroundColorIndex = xlAutomatic
  62.                 '.MarkerStyle = xlNone
  63.                 '.Smooth = False
  64.                 '.MarkerSize = 7
  65.                 '.Shadow = False
  66.             End With
  67.         Next
  68.     End With
  69. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# lamihsuen
¨S¿ù¡A©p¤]¥i¥HÀ³¥Î¤U¦C Set Sh = Sheets(xlSh) ¥H¤Î  With Sh.ChartObjects.Add ªº¤è¦¡¨Ó³B²z¡G
  1. Private Sub »s¹Ïµ{§Ç(xlSh As String)                                '  ­«Ã¸
  2.     Dim Sh As Worksheet, xi As Integer
  3.    
  4.     Set Sh = Sheets(xlSh)
  5.     Sh.ChartObjects.Delete

  6.     °}¦C³]©w ShName:=Sh.Name
  7.     For xi = 1 To IIf(Sh.Name = "Omega", 5, 6)
  8.         With Sh.ChartObjects.Add(Sh.Cells(xRow(xi), yCol(xi)).Left, Sh.Cells(xRow(xi), yCol(xi)).Top, cWidth(xi), cHeight(xi)).Chart
  9.             .ChartType = IIf(xi >= 5, xlLine, xlColumnStacked)      ' xlLine-> §é½u¹Ï        ' xlColumnStacke-> °ïÅ|ª½±ø¹Ï
  10.             .SetSourceData Source:=Chart_Source(xi)
  11.             .HasLegend = 0                                          ' ¹Ïªíªº¹Ï¨Ò:  ¤£¥i¨£
  12.             .SeriesCollection(1).AxisGroup = IIf(xi >= 5, 2, 1)
  13.             
  14.             If (xi = 5) Then
  15.                 .SeriesCollection(4).ChartType = xlColumnClustered  ' °ïÅ|ª½±ø¹Ï
  16.             ElseIf (xi = 6) Then
  17.                 .SeriesCollection(2).ChartType = xlColumnClustered  ' °ïÅ|ª½±ø¹Ï
  18.             End If

  19.             With .Axes(xlCategory)                                  ' X®y¼Ð¶b
  20.                 .CategoryType = xlCategoryScale
  21.                 .TickLabels.NumberFormatLocal = "hh:mm"
  22.                 .MajorTickMark = xlNone
  23.                 .Border.Weight = xlHairline
  24.                 .Border.LineStyle = xlNone
  25.                 .TickLabelPosition = xlLow
  26.                 .TickLabels.Font.Size = 10
  27.             End With

  28.             '*******************************************************************
  29.             '  .
  30.             '  .
  31.             '  .

  32.         End With
  33.     Next xi
  34. End Sub
½Æ»s¥N½X
§Ú¦Aªþ¤W§Ú¹ê°ÈÀ³¥Î¤Wªº¯u¹ê¹Ïªí´£¨Ñ©p°Ñ¦Ò¡CµL½×¬O¦óºØªí³æ¹Ï§Î¡A¨ä³]­p²z©À´X¥G¬O¹p¦Pªº¡C

TOP

¦^´_ 6# lamihsuen
½Ðªþ¤W§A¹ê»ÚªºÀɮסA§Ú¨Ó¬Ý¬Ý§A¬O¦p¦ó³]©w¡C
P.S.  ©p¨S«ö "¦^´_" ¶s¦^´_¡A¦pªG§Ú¨S¦³¯d·N¨ìªº¸Ü¡A¬O¤£ª¾¹D¦³¦^´_¥óªº¡C

TOP

¦^´_ 8# lamihsuen
½Ð±N­ì¥» Module3 ¤ºªºµ{¦¡½X¥þ³¡§ó´«¦¨¥H¤U¤§µ{¦¡½X
  1. ' *********************************************************************
  2. '  Module3   (½Ð±N­ì¥» Module3 ¤ºªºµ{¦¡½X¥þ³¡§ó´«¦¨¥H¤U¤§µ{¦¡½X)
  3. ' *********************************************************************
  4. Option Explicit

  5. Dim sPos(1 To 4)
  6. Dim xText As String
  7. Dim Chart_Source As Variant
  8. Dim StartKBarRow, EndKBarRow As Long

  9.    
  10. Public Sub ¦A¤ÀªRµ²ªG()
  11.     Dim wr As Integer, an As Integer ' ³]©wCOPY¤u§@ªí¼Æ¥Ø­p¼Æ¾¹
  12.     Dim xlRow As Long
  13.             
  14.     ' wr = 4  ¥Ø«e¹w³]±q c ¨ì sn¡A Á`¦@¦³ 12 ­Ó¤u§@ªí³æ
  15.     For wr = 4 To Worksheets.Count
  16.         '  ¤U¦¸°_©l ¦C °_ÂI
  17.         Dim angin_sr As Integer
  18.         Dim sr As Integer ' ©w¸q²Ä¤@¦¸°_©l¦C¼Æ
  19.         sr = 6
  20.         an = 1
  21.         ' ­pºâ"NG"ªº®a¼Æ
  22.         Dim NGVALUE As Integer
  23.         NGVALUE = 0
  24.         ' ¤u§@ªí±q4 °j°é¶}©l°õ¦æ¦A¤ÀªRµ²ªG¨ì¤u§@ªíªº³Ì«á
  25.         Do Until Worksheets(wr).Cells((sr - 3), 12).Value = 0
  26.             ' outline ¤ÀªR¦¸¼Æ+1.¨ÃÅã¥Ü¦b¼ÐÃD¦C(B4)Àx¦s®æ
  27.             an = an + 1
  28.                   
  29.             ' angin_sr=¦A¦¸¤ÀªR°_©l¦C¬°:²Ä¤@¦¸°_©l¦C¼Æ+²Ä¤@¦¸®a¼Æ+6®æªÅ®æ
  30.             angin_sr = sr + (Worksheets(wr).Cells((sr - 3), 1).Value + 6)
  31.                
  32.             ' §P§O ¤W¦¸¤ÀªR¦³"NG"ªº¥h°£,"OK"ªºCOPY¨ì¥»¦¸ªí®æ
  33.             Dim again_oi, again_oj   As Integer ' ¤W¦¸ªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  34.             Dim again_ai, again_aj   As Integer ' ¥»¦¸ªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  35.                      
  36.             again_oi = sr
  37.             again_ai = angin_sr
  38.             ' °j°é§P§O"ok"»P"ng"±q«e¦¸°_©l¦ì¸m¶}©l(sr)¦Ü«e¦¸ªí®æ³Ì«á(sr+«e¦¸ªí®æ"a"3ªº­È
  39.             For again_oi = again_oi To sr + Worksheets(wr).Cells((sr - 3), 1).Value
  40.                 ' ¦pªG­È¬°"ok"¸Ó¦Ccopy ¨ì¥»¦¸ªí®æ.¦pªG­È¬°"ng"«h¤£³B²z
  41.                 If Worksheets(wr).Cells(again_oi, 5).Value = "OK" Then
  42.                     With Worksheets(wr)
  43.                         .Cells(again_ai, 1).Value = .Cells(again_oi, 1).Value
  44.                         .Cells(again_ai, 2).Value = .Cells(again_oi, 2).Value
  45.                     End With
  46.                     again_ai = again_ai + 1
  47.                 End If
  48.             Next again_oi
  49.                   
  50.             ' ±N«e¦¸²Ä¤T¦C¼ÐÃD¦C¼ÐÃDcopy ¦Ü¥»¦¸ªí®æ²Ä¤T¦C¼ÐÃD¦C¼ÐÃD
  51.             again_aj = 1
  52.             For again_oj = 1 To 12
  53.                 Worksheets(wr).Cells(angin_sr - 4, again_aj).Value = Worksheets(wr).Cells(sr - 4, again_oj).Value
  54.                 again_aj = again_aj + 1
  55.             Next again_oj
  56.                        
  57.             ' §Q¥ÎÅܼƨD¥X¥»¦¸ªí®æ³Ì«á¦C¼Æ¥Øªº¥Î©ó¨D¥X²Ä¤T¦C¤½¦¡ªº³Ì«á½d³ò
  58.             xlRow = Worksheets(wr).Range("B" & angin_sr).End(xlDown).Row
  59.             With Worksheets(wr)
  60.                 ' ­pºâ¥»¦¸"A3"Àx¦s®æ NO.OF.RESULT­È(¤ÀªR­È®a¼Æ)±q¥»¦¸°_©l¦C¦Ü(angin_sr)¦Ü¥»¦¸³Ì«á¦C¼Æªº¼Æ¶q
  61.                 .Cells(angin_sr - 3, 1).Formula = "=COUNT(B" & angin_sr & ":B" & xlRow & ")"
  62.                 ' ¥»¦¸"B3"Àx¦s®æ¤ÀªR­È¤¤¶¡­È(MEDIAN)
  63.                 .Cells(angin_sr - 3, 2).Formula = "=MEDIAN(B" & angin_sr & ":B" & xlRow & ")"
  64.                 ' ¥»¦¸C3Àx¦s®æIRQ´Ó
  65.                 .Cells(angin_sr - 3, 3).Formula = "=(QUARTILE(B" & angin_sr & ":B" & xlRow & ",3) -QUARTILE(B" & angin_sr & ":B" & xlRow & ",1))*0.7413"
  66.                         
  67.                 ' ¥»¦¸"E3"Àx¦s®æROBUS CV­È
  68.                 .Cells(angin_sr - 3, 5).Formula = "=  C3 / B3 *100"
  69.                 ' ¥»¦¸"F3"Àx¦s®æ¤ÀªR­È¤¤³Ì¤Ö­È
  70.                 .Cells(angin_sr - 3, 6).Formula = "=MIN(B" & angin_sr & ":B" & xlRow & ")"
  71.                 ' ¥»¦¸"G3"Àx¦s®æ¤ÀªR­È¤¤³Ì¤j­È
  72.                 .Cells(angin_sr - 3, 7).Formula = "=MAX(B" & angin_sr & ":B" & xlRow & ")"
  73.                 ' ¥»¦¸"H3"Àx¦s®æRANGE­È
  74.                 .Cells(angin_sr - 3, 8).Formula = "=G3-F3"
  75.                 ' ¥»¦¸©w¸q"I3"Àx¦s®æ¬°E178­È
  76.                 .Cells(angin_sr - 3, 9).Value = E178(.Cells(angin_sr - 3, 1).Value)
  77.                 ' ¥»¦¸©w¸q"j3"Àx¦s®æ¬°¤ÀªR­È¥­§¡­È
  78.                 .Cells(angin_sr - 3, 10).Formula = "=AVERAGE(B" & angin_sr & ":B" & xlRow & ")"
  79.                 ' ¥»¦¸©w¸q"k3"Àx¦s®æ¬°stdv
  80.                 .Cells(angin_sr - 3, 11).Formula = "=STDEV(B" & angin_sr & ":B" & xlRow & ")"
  81.                 ' ¥»¦¸"NG"®a¼Æ ­È
  82.                 .Cells(angin_sr - 3, 12).Value = NGVALUE
  83.                 ' ¥»¦¸¼ÐÃD¦C"°õ¦æ²Ä"¦r¦êª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  84.                 .Cells(angin_sr - 2, 1).Value = .Cells(sr - 2, 1).Value
  85.                 ' ¥»¦¸¼ÐÃD¦CÅã¥Ü²Äan¦¸¤ÀªR
  86.                 .Cells(angin_sr - 2, 2).Value = an
  87.                 ' ¥»¦¸¼ÐÃD¦C"ouline"¦r¦êª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  88.                 .Cells(angin_sr - 2, 3).Value = .Cells(sr - 2, 3).Value
  89.                 ' ¥»¦¸©w¸q¹êÅç«Ç½s¸¹¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  90.                 .Cells(angin_sr - 1, 1).Value = .Cells(sr - 1, 1).Value
  91.                 ' ¥»¦¸©w¸q¹êÅç«Ç¤ÀªR­È¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  92.                 .Cells(angin_sr - 1, 2).Value = .Cells(sr - 1, 2).Value
  93.                 ' ¥»¦¸©w¸qz-score­È¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  94.                 .Cells(angin_sr - 1, 3).Value = .Cells(sr - 1, 3).Value
  95.                 ' ¥»¦¸©w¸qoutline¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  96.                 .Cells(angin_sr - 1, 4).Value = .Cells(sr - 1, 4).Value
  97.                 ' ©w¸q§P©wµ²ªG­È¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸mcopy
  98.                 .Cells(angin_sr - 1, 5).Value = .Cells(sr - 1, 5).Value
  99.                 ' ¥»¦¸"C"Äæ Z-SCORE ­È­pºâ
  100.                 .Range("C" & angin_sr & " :C" & xlRow).Formula = "=(b" & angin_sr & "-$B$" & angin_sr - 3 & ") /$C$" & angin_sr - 3
  101.                 ' ¥»¦¸ "D"ÄæOUTLINE­È­pºâ
  102.                 .Range("d" & angin_sr & " :d" & xlRow).Formula = "= (B" & angin_sr & " -$J$" & angin_sr - 3 & ")/$K$" & angin_sr - 3
  103.                                       
  104.             End With
  105.                        
  106.             ' ¥»¦¸"E' Äæ§P§OOUTLINE,  true="ok"  FALSE="NG"
  107.             ' "NG"®a¼Æ°_©l­È ,¥Øªº"±N¦³"ng"®a¼Æ°O¿ý¦b"L3"Äæ¦ì¥Î©ó¬O§_Ä~Äò§P§OOUTLINE
  108.                        
  109.             Worksheets(wr).Range("L" & angin_sr - 3).Value = 0
  110.                        
  111.             ' ¶}©l§P§O±q¥»¦¸°_©l¦C¶}©l
  112.             again_ai = angin_sr
  113.                           
  114.             For again_ai = again_ai To ((angin_sr) + Worksheets(wr).Range("A" & angin_sr - 3).Value - 1)
  115.                 ' ¤ñ¹ïD6¬O§_<   E178­È(I3)Äæ
  116.                 If Worksheets(wr).Range("D" & again_ai).Value < Worksheets(wr).Range("I" & angin_sr - 3).Value Then
  117.                     ' ­È=TRUE®ÉEÄæ°O¿ý""OK"
  118.                     Worksheets(wr).Range("E" & again_ai).Value = "OK"
  119.                 Else
  120.                     ' ­È= FLACE®ÉEÄæ°O¿ý"NG"
  121.                     Worksheets(wr).Range("E" & again_ai).Value = "NG"
  122.                     ' ³]"NG"FONT.COLOR¬°¬õ¦â
  123.                     Worksheets(wr).Range("E" & again_ai).Font.Color = vbRed
  124.                     ' "NG"®a¼Æ+1
  125.                     Worksheets(wr).Range("L" & angin_sr - 3).Value = Worksheets(wr).Range("L" & angin_sr - 3).Value + 1
  126.                 End If
  127.             Next again_ai
  128.                                  
  129.             ' ¦pªGÁÙ¦³"NG"­ÈÄ~Äò°õ¦æOUTLINE
  130.             ' ±N¥»¦¸ªí®æ¦C¼Æ­È³]©wµ¹¤W¦¸ªí®æ¦C¼Æ¥Øªº±N¥»¦¸ªí®æ¦C¼Æ§@¬°¤U¦¸ªí®æ­pºâ°ò¦
  131.             sr = angin_sr
  132.         Loop
  133.                
  134.         ' ********¦¹³B¬°Worksheets(wr).Cells((sr - 3), 12).Value =0."NG" ®a¼Æ=0 ¥þ³¡""¥i°õ¦æZ-SCORE
  135.         ' ©w¸qz_sr¬°z_score°_©lªí®æ¦C
  136.         Dim z_sr As Integer
  137.         angin_sr = sr ' ±Nsr­È¦^´pµ¹angin_sr¥Øªº¬°§â³Ì«á¤@¦¸outline "sr=angin_sr"¦^´p¦^¨Ó
  138.         sr = 6 ' ±Nsr¦^´p¨ì²Ä¤@¦¸ªí®æ°_©l¦ì¸m
  139.               
  140.         ' z_sr=°õ¦æz-score°_©l¦C¬°:³Ì«á¤@¦¸°_©l¦C¼Æ+³Ì«á¤ÀªR®a¼Æ+6®æªÅ®æ
  141.         z_sr = angin_sr + (Worksheets(wr).Cells((angin_sr - 3), 1).Value + 6)
  142.               
  143.         ' ³]©w¤¸¯Àz_score¼ÐÃD¦C¼ÐÃD(z_scoreªº²Ä¤T¦C)
  144.         Worksheets(wr).Cells((z_sr - 2), 1).Value = "°õ¦æ"
  145.         Worksheets(wr).Cells((z_sr - 2), 2).Value = Worksheets(wr).Name
  146.         Worksheets(wr).Cells((z_sr - 2), 3).Value = "z_score"
  147.                   
  148.         ' ±N²Ä¤@¦¸ªí®æ"¹êÅç«Ç½s¸¹"(²Ä¤@¦æ¸¹)»P"¤ÀªR­È"(²Ä¤G¦æ)copy¦Üz_scoreªí®æ¦]¬°­n¥þ³¡"¹êÅç«Ç½s¸¹"»P"¤ÀªR­È"
  149.                     
  150.         Dim z_oi, z_oj   As Integer    ' ²Ä¤@¦¸ªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  151.         Dim z_ai, z_aj   As Integer    ' z-scoreªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  152.         z_oi = sr                      ' z_oi©w¸q¬°²Ä¤@¦¸°_©l®æªí®æ¶}©l­p¼Æ
  153.         z_ai = z_sr                    ' z_ai©w¸q¬°z_score°_©lªí®æ¶}©l­p¼Æ
  154.                  
  155.         For z_oi = z_oi To sr + Worksheets(wr).Cells((sr - 3), 1).Value
  156.             With Worksheets(wr)
  157.                 .Cells(z_ai, 1).Value = .Cells(z_oi, 1).Value
  158.                 .Cells(z_ai, 2).Value = .Cells(z_oi, 2).Value
  159.             End With
  160.             z_ai = z_ai + 1
  161.         Next z_oi      
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-20 16:46 ½s¿è

¦^´_ 8# lamihsuen
¦]µ{¦¡½X¤j©ó³W©w¤j¤p¡A¬G±N¤U¥b¬q¦A¦¸¶K¤W¡C
  1.         ' ±N³Ì«á¤@¦¸²Ä¤@¦C(¤½¦¡)¼ÐÃD¦C¼ÐÃD»P²Ä¤G¦C¤½¦¡­Ècopy ¦ÜZSCOREªí®æ²Ä¤@¦C»P²Ä¤G¦C
  2.         z_oi = angin_sr
  3.         z_ai = z_sr
  4.         z_aj = 1
  5.         For z_oj = 1 To 12
  6.             Worksheets(wr).Cells(z_ai - 4, z_aj).Value = Worksheets(wr).Cells(z_oi - 4, z_oj).Value
  7.             Worksheets(wr).Cells(z_ai - 3, z_aj).Value = Worksheets(wr).Cells(z_oi - 3, z_oj).Value
  8.             z_aj = z_aj + 1
  9.         Next z_oj
  10.         ' ©w¸q²Ä¥|¦Cªí®æ¼ÐÃD¦C
  11.         xlRow = Worksheets(wr).Range("B" & z_sr).End(xlDown).Row
  12.         With Worksheets(wr)
  13.             .Cells((z_sr - 1), 1).Value = .Cells((sr - 1), 1).Value
  14.             .Cells((z_sr - 1), 2).Value = .Cells((sr - 1), 2).Value
  15.             .Cells((z_sr - 1), 3).Value = .Cells((sr - 1), 3).Value
  16.             .Cells((z_sr - 1), 4).Value = "§P§Oµ²ªG"
  17.             .Cells((z_sr - 1), 5).Value = "¤ÀªR¤èªk"
  18.             .Cells((z_sr - 1), 6).Value = "¨Ï¥Î»ö¾¹"
  19.                                                          
  20.             ' ¥»¦¸"C"Äæ Z-SCORE ­È­pºâ
  21.             .Range("C" & z_sr & " :C" & xlRow).Formula = "=(b" & z_sr & "-$B$" & z_sr - 3 & ") /$C$" & z_sr - 3
  22.             .Range("D" & z_sr & " :D" & xlRow).Formula = "=IF(C" & z_sr & ">=3,""²§±`"",IF( C" & z_sr & "<=2,""ok"",""¦³½èºÃ""))"
  23.         End With
  24.         '  ©w¸qz­È§P§Oµ²ªG¨ÃÅã¥Ü(D)Äæ,"(Z)­È<=2¬°"OK"Åã¥Üºñ¦â","2<(Z)­È<3¬°"¦³½èºÃ"Åã¥Ü¶À¦â,(Z)­È>3¬°"²§±`"Åã¥Ü¬õ¦â
  25.                                        
  26.         '  Ã¸»s²Î­p¤ÀªR¹Ïªí
  27.         Call DrawStatistics(wr)
  28.     Next wr
  29. End Sub

  30. Sub DrawStatistics(ct As Integer)
  31.     Dim tbl As String

  32.     StartKBarRow = 6
  33.     With Worksheets(ct)
  34.         tbl = .Name
  35.         EndKBarRow = .Range("A1").CurrentRegion.Rows.Count
  36.         Set Chart_Source = Range(tbl & "!$C$" & CStr(StartKBarRow) & ":" & tbl & "!$C$" & CStr(EndKBarRow))
  37.         sPos(1) = CInt(Mid("205*090*090*100*132*096*132*090*173*090*314*090", (ct - 4) * 4 + 1, 3))
  38.         sPos(2) = CInt(Mid("001*001*001*001*001*001*001*001*001*001*001*001", (ct - 4) * 4 + 1, 3))
  39.         sPos(3) = CInt(Mid("720*720*720*720*720*720*720*720*720*720*720*720", (ct - 4) * 4 + 1, 3))
  40.         sPos(4) = CInt(Mid("320*320*320*320*320*320*320*320*320*320*320*320", (ct - 4) * 4 + 1, 3))
  41.         xText = UCase(tbl) & " : Z - Score"
  42.         »s¹Ïµ{§Ç xlSh:=tbl
  43.     End With
  44. End Sub

  45. Private Sub »s¹Ïµ{§Ç(xlSh As String)                                ' ¥þ³¡­«Ã¸
  46.     Dim Sh As Worksheet, xi As Integer
  47.    
  48.     Set Sh = Sheets(xlSh)
  49.     Sh.ChartObjects.Delete

  50.     With Sh.ChartObjects.Add(Sh.Cells(sPos(1), sPos(2)).Left, Sh.Cells(sPos(1), sPos(2)).Top, sPos(3), sPos(4)).Chart
  51.         .ChartType = xlColumnClustered    ' xlColumnStacked                            ' xlColumnStacke-> °ïÅ|ª½±ø¹Ï
  52.         .SetSourceData Source:=Chart_Source
  53.         .HasLegend = 0                                          ' ¹Ïªíªº¹Ï¨Ò:  ¤£¥i¨£
  54.         .SeriesCollection(1).AxisGroup = 1
  55.             
  56.         With .Axes(xlCategory)                                  ' X®y¼Ð¶b
  57.             .CategoryType = xlCategoryScale
  58.             ' .TickLabels.NumberFormatLocal = "hh:mm"
  59.             .MajorTickMark = xlNone
  60.             .Border.Weight = xlHairline
  61.             .Border.LineStyle = xlNone
  62.             .TickLabelPosition = xlLow
  63.             .TickLabels.Font.Size = 10
  64.         End With
  65.                   
  66.             '*******************************************************************
  67.                   
  68.         With .SeriesCollection(1)
  69.             .Shadow = False                                ' ¹Ïªí¤¤ªº¼Æ¦C(1)
  70.             .InvertIfNegative = True
  71.             ' .InvertColor = RGB(255, 124, 128)                      ' ·íªí¦C¼Æ­È¬°­t­È®É¡A±N¨äÅã¥Ü¤§ÃC¦â§óÅܦ¨²L¤ÑÂŦâ
  72.             .InvertColor = RGB(32, 178, 208)                         ' ·íªí¦C¼Æ­È¬°­t­È®É¡A±N¨äÅã¥Ü¤§ÃC¦â§óÅܦ¨«CÂŦâ
  73.         
  74.             With .Format.Fill
  75.                 .Visible = msoTrue
  76.                 ' .ForeColor.RGB = RGB(149, 179, 215)                ' ·íªí¦C¼Æ­È¬°¥¿­È®É¡AÅã¥Ü¤§ÃC¦â¬°¾ï¬õ¦â
  77.                 .ForeColor.RGB = RGB(255, 69, 0)                     ' ·íªí¦C¼Æ­È¬°¥¿­È®É¡AÅã¥Ü¤§ÃC¦â¬°¯»¬õ¦â
  78.                 .Transparency = 0
  79.                 .Solid
  80.             End With
  81.         
  82.             With .Border
  83.                 .Weight = xlHairline
  84.                 .LineStyle = xlNone
  85.             End With
  86.         
  87.             ' With .Interior
  88.             '     .ColorIndex = 5
  89.             '     .PatternColorIndex = 42
  90.             '     .Pattern = xlSolid
  91.             ' End With
  92.         End With
  93.                   
  94.         ' *******************************************************************
  95.                      
  96.         With .Axes(xlValue).TickLabels.Font                    ' Y®y¼Ð¶b¤W¨è«×ªº¨è«×¼ÐÅÒªº¦rÅé
  97.             .FontStyle = "¼Ð·Ç"
  98.             .Size = 10
  99.         End With
  100.                      
  101.         With .Axes(xlValue)
  102.             .MajorUnit = 2                                     ' ¹Ïªí¥ª°¼¼Æ¦C¤§¶¡¶Z­È³]©w
  103.             ' .MaximumScale = 30
  104.             ' .MinimumScale = -40
  105.         End With
  106.         
  107.         .HasTitle = True                                       ' ¹Ïªíªº¼ÐÃD   ¥i¨£
  108.               
  109.         With .ChartTitle                                       ' ¹Ïªíªº¼ÐÃD
  110.             .Top = 1
  111.             .Text = xText
  112.             .Font.Size = 16
  113.         End With

  114.         With .PlotArea                                         ' ¹ÏªíªºÃ¸¹Ï°Ï
  115.             .Top = 16
  116.             .Left = 1
  117.             .Width = sPos(3)
  118.             .Height = sPos(4)
  119.             .Interior.ColorIndex = xlNone
  120.         End With
  121.     End With
  122. End Sub
½Æ»s¥N½X
À³¸Óº¡¨¬©pªº­n¨D¤F§a¡I

TOP

¦^´_ 11# lamihsuen
©p«üªº"¦p¦ó³]©wµ{¦¡«e­±§Ç¸¹"§ÚÁÙ¤£¬ÆÁA¸Ñ¦ó·N¡AÁ|­Ó¨Ò¤l¡H
¨Æ«á¡A§Ú¤S¥[¤F DataLabels ¶i¥h¡A¤º®e¦p¤U¡G
  1. (1)
  2. Sub DrawStatistics(ct As Integer)
  3.     Dim tbl As String

  4.     StartKBarRow = 6
  5.     With Worksheets(ct)
  6.         tbl = .Name
  7.         EndKBarRow = .Range("A1").CurrentRegion.Rows.Count
  8.         Set Chart_Source = Range(tbl & "!$C$" & CStr(StartKBarRow) & ":" & tbl & "!$C$" & CStr(EndKBarRow))
  9.         sPos(1) = CInt(Mid("205*090*090*100*132*096*132*090*173*090*314*090", (ct - 4) * 4 + 1, 3))    ' ¹Ï¼Ð®y¼Ð(¦C)
  10.         sPos(2) = CInt(Mid("001*001*001*001*001*001*001*001*001*001*001*001", (ct - 4) * 4 + 1, 3))    ' ¹Ï¼Ð®y¼Ð(Äæ)
  11.         ' sPos(3) = CInt(Mid("720*720*720*720*720*720*720*720*720*720*720*720", (ct - 4) * 4 + 1, 3))  ' ¹Ïªí¼e«×
  12.         ' ±N 12 ­Ó²Î­p¹Ïªí¼e«× 720 §¡§ï¦¨ 900¡A¦p¦¹¡A©ó¥[¤W DataLabels «á©¼¦¹¶¡ªº¶ZÂ÷·|Åܬ°¼eÃP¡A¦r¶Z¤ñ¸û¤£·|­«Å|¦A¤@°_¡C
  13.         sPos(3) = CInt(Mid("900*900*900*900*900*900*900*900*900*900*900*900", (ct - 4) * 4 + 1, 3))   
  14.         sPos(4) = CInt(Mid("320*320*320*320*320*320*320*320*320*320*320*320", (ct - 4) * 4 + 1, 3))    ' ¹Ïªí°ª«×
  15.         xText = UCase(tbl) & " : Z - Score"
  16.         »s¹Ïµ{§Ç xlSh:=tbl
  17.     End With
  18. End Sub

  19. (2)
  20.         With .SeriesCollection(1)
  21.             ' .
  22.             ' .
  23.             ' .
  24.             With .Border
  25.                 .Weight = xlHairline
  26.                 .LineStyle = xlNone
  27.             End With
  28.         
  29.             ' ¥[¤W DataLabels ¤ñ¸û¦³¬ÝÀY (¥H¤U¤T¦æ)¡A¼Æ¾Úªí¹F¤]¸û¿Ë©M©Ê¡C
  30.             .HasDataLabels = True
  31.             .DataLabels.NumberFormat = "##.####"    ' ¨ú¤p¼Æ¥|¦ì
  32.             .DataLabels.Position = xlLabelPositionOutsideEnd
½Æ»s¥N½X

TOP

¦^´_ 11# lamihsuen
©p¬O«ü
Dim sPos(1 To 4)      
'  «Å§i¤@­Ó¤½¥Î¤@ºû°}¦C¾ã¼Æ­ÈÅܼơA¥¦¦bDrawStatistics()¥H¤Î »s¹Ïµ{§Ç() ³£·|¨Ï¥Î¨ì¡C
Dim xText As String
'  «Å§i¤@­Ó¤½¥Î¦r¦êÅܼơA¥¦¦bDrawStatistics()¥H¤Î »s¹Ïµ{§Ç() ³£·|¨Ï¥Î¨ì¡C
Dim Chart_Source As Variant
' «Å§i¤@­Ó¤½¥Î Variant ¸ê®Æ«¬ºAÅܼơA¥Î©ó¬ö¿ý¹Ïªí¿ï¨ú¸ê®Æ¡A¥¦¦bDrawStatistics()¥H¤Î »s¹Ïµ{§Ç() ³£·|¨Ï¥Î¨ì¡C
Dim StartKBarRow, EndKBarRow As Long   
' ¥Î©ó¬ö¿ý¿ï¨ú¸ê®Æªº°_©l¡BºI¤î¦C¼Æ (°ÊºA¬ö¿ý¸ê®Æ¿ý¤§¥Î)¡C¥¦¥u¦³¦bDrawStatistics()¤º³¡¨Ï¥Î¡A¬OÀ³¸Ó©ñ¸m©ó
' DrawStatistics() ¤º«Å§iªº¡C·íªì¶}©l¼¶¼g®É¡A­ì¥»¦Ò¼{·|¸ó²[¦¡¦Ó±N¥¦¸m©ñ©ó¥~³¡¡Aµ{¦¡§ï¤F§ï«o§Ñ±¼¤F¡C
¶Ü¡H

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-21 06:42 ½s¿è

¦^´_ 11# lamihsuen
¹Ï¼Ð®y¼Ð(¦C)§ï¥H°ÊºA³B²z
  1. Sub DrawStatistics(ct As Integer)
  2.     Dim tbl As String
  3.     Dim totalRow As Long

  4.     StartKBarRow = 6
  5.     With Worksheets(ct)
  6.         tbl = .Name
  7.         EndKBarRow = .Range("A1").CurrentRegion.Rows.Count
  8.         Set Chart_Source = Range(tbl & "!$C$" & CStr(StartKBarRow) & ":" & tbl & "!$C$" & CStr(EndKBarRow))
  9.         
  10.         ' sPos(1) = CInt(Mid("205*090*090*100*132*096*132*090*173*090*314*090", (ct - 4) * 4 + 1, 3)) ' ¹Ï¼Ð®y¼Ð(¦C)
  11.         ' ¬°¦Ò¶q¦b¹ê°È¹B¥Î¤W¡A¨C±iªí³æ¤º§t¸ê®Æ¤º®e¤§¦h¹è¤£¤@¡A¥i¯à¹ê»Ú¨Ï¥Î¦C¼Æ®É¦³¼W´î¡A¬G§ï¥H°ÊºA³B²z¡C
  12.         sPos(1) = .UsedRange.Rows.Count
  13.         While IsEmpty(.Cells(sPos(1), 3).Value) And sPos(1) > 6       ' ©|¶·¦A¦¸¹LÂo³¡¤ÀªÅ¥Õ»P«D¯u¹ê¶×¤J¸ê®Æªº°ÝÃD¦C
  14.             sPos(1) = sPos(1) - 1
  15.         Wend
  16.         sPos(1) = sPos(1) + 5
  17.         
  18.         sPos(2) = CInt(Mid("001*001*001*001*001*001*001*001*001*001*001*001", (ct - 4) * 4 + 1, 3))   ' ¹Ï¼Ð®y¼Ð(Äæ)
  19.         sPos(3) = CInt(Mid("900*900*900*900*900*900*900*900*900*900*900*900", (ct - 4) * 4 + 1, 3))   ' ¹Ïªí¼e«×
  20.         sPos(4) = CInt(Mid("320*320*320*320*320*320*320*320*320*320*320*320", (ct - 4) * 4 + 1, 3))   ' ¹Ïªí°ª«×
  21.         xText = UCase(tbl) & " : Z - Score"
  22.         »s¹Ïµ{§Ç xlSh:=tbl
  23.     End With
  24. End Sub
½Æ»s¥N½X
¯¬©P¥½´r§Ö¡I

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-21 07:31 ½s¿è

¦^´_ 11# lamihsuen
¶K¤£¤W¹Ï¡A§Ú´N¥Î¼gªº¡G
½Ðª`·N¥H¤U¨â­Ó¤£¦P»yªk¤§¨Ï¥Î¡A¨äµ²ªG­È(¥H c ¤u§@ªí³æ¬°¨Ò ) ¤@­Ó¬O 50¡A¥t¤@­Ó¬O 200 (¦A¥[¤W5)¡C
(1)
        EndKBarRow = .Range("A1").CurrentRegion.Rows.Count
(2)
        ' sPos(1) = CInt(Mid("205*090*090*100*132*096*132*090*173*090*314*090", (ct - 4) * 4 + 1, 3)) ' ¹Ï¼Ð®y¼Ð(¦C)
        ' ¬°¦Ò¶q¦b¹ê°È¹B¥Î¤W¡A¨C±iªí³æ¤º§t¸ê®Æ¤º®e¤§¦h¹è¤£¤@¡A¥i¯à¹ê»Ú¨Ï¥Î¦C¼Æ®É¦³¼W´î¡A¬G§ï¥H°ÊºA³B²z¡C
        sPos(1) = .UsedRange.Rows.Count
        While IsEmpty(.Cells(sPos(1), 3).Value) And sPos(1) > 6       ' ©|¶·¦A¦¸¹LÂo³¡¤ÀªÅ¥Õ»P«D¯u¹ê¶×¤J¸ê®Æªº°ÝÃD¦C
            sPos(1) = sPos(1) - 1
        Wend
        sPos(1) = sPos(1) + 5                                                                    ' ¹Ï¼Ð®y¼Ð(¦C)
CurrentRegion »P UsedRange ªº¹B¥Î®t²§©Ê¡C

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-21 17:50 ½s¿è

¦^´_ 20# lamihsuen
¥H "c" ¤u§@ªí¬°¨Ò¡A¦@¦³¥|­Ó°Ï¶¡¡A6-51,58-102,109-152,159-204¡A©Î
¥H "ni" ¤u§@ªí¬°¨Ò¡A¦@¦³¤T­Ó°Ï¶¡¡A6-42,49-84,91-127¡A©Î
¥H "mo" ¤u§@ªí¬°¨Ò¡A¦@¦³¥|­Ó°Ï¶¡¡A6-42,49-84,91-125,132-168¡C
¦b¹ê°È¤W©p¬O¦p¦ó§P©w­þ­Ó¤u§@ªí³æ¤§°Ï¶¡¬OÄÝ­þ¤@­Ó°Ï¶¡¡H
(¤]´N¬O12 ­Ó¦U¦Û¤u§@ªí³æ¨s³ºÀ³¿ï¾Ü­þ¤@­Ó°Ï¶¡§@¬°¹Ïªíªº "¿ï¨ú¸ê®Æ"¡H)

§Ú§â©pªº Module3 µyµy¾ã²z¤F¤@¤U¡A½Ð¯d·N¬O¨º¨ÇÅܤƤF¡H
  1. Option Explicit

  2. Dim sPos(1 To 4)
  3. Dim xText As String
  4. Dim Chart_Source As Variant
  5.    
  6. Public Sub ¦A¤ÀªRµ²ªG()
  7.     Dim wr As Integer, an As Integer     ' ³]©wCOPY¤u§@ªí¼Æ¥Ø­p¼Æ¾¹
  8.     Dim xlRow As Long
  9.     Dim angin_sr As Integer              ' ¤U¦¸°_©l ¦C °_ÂI
  10.     Dim sr As Integer                    ' ©w¸q²Ä¤@¦¸°_©l¦C¼Æ
  11.     Dim NGValue As Integer               ' ­pºâ "NG" ªº®a¼Æ
  12.     Dim again_oi, again_oj As Integer    ' ¤W¦¸ªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  13.     Dim again_ai, again_aj As Integer    ' ¥»¦¸ªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  14.     Dim chart_end As Integer
  15.     Dim z_sr As Integer
  16.     Dim z_oi, z_oj As Integer            ' ²Ä¤@¦¸ªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  17.     Dim z_ai, z_aj As Integer            ' z-scoreªí®æ¦C,¦æ¼Æ­p¼Æ¾¹
  18.     Dim mue_sr, mue_oi As Integer
  19.             
  20.     ' wr = 4  ¥Ø«e¹w³]±q c ¨ì sn¡A Á`¦@¦³ 12 ­Ó¤u§@ªí³æ
  21.     For wr = 4 To Worksheets.Count
  22.         sr = 6
  23.         an = 1
  24.         
  25.         NGValue = 0
  26.         
  27.         With Worksheets(wr)
  28.             ' ¤u§@ªí±q 4 °j°é¶}©l°õ¦æ¦A¤ÀªRµ²ªG¨ì¤u§@ªíªº³Ì«á
  29.             Do Until .Cells((sr - 3), 12).Value = 0
  30.                 ' outline ¤ÀªR¦¸¼Æ + 1.¨ÃÅã¥Ü¦b¼ÐÃD¦C (B4) Àx¦s®æ
  31.                 an = an + 1
  32.                        
  33.                 ' angin_sr=¦A¦¸¤ÀªR°_©l¦C¬°:²Ä¤@¦¸°_©l¦C¼Æ+²Ä¤@¦¸®a¼Æ+6®æªÅ®æ
  34.                 angin_sr = sr + (.Cells((sr - 3), 1).Value + 6)
  35.                
  36.                 ' §P§O ¤W¦¸¤ÀªR¦³"NG"ªº¥h°£,"OK"ªºCOPY¨ì¥»¦¸ªí®æ
  37.                 again_oi = sr
  38.                 again_ai = angin_sr
  39.                 ' °j°é§P§O "ok" »P "ng" ±q«e¦¸°_©l¦ì¸m¶}©l(sr)¦Ü«e¦¸ªí®æ³Ì«á(sr+«e¦¸ªí®æ"a"3)ªº­È
  40.                 For again_oi = again_oi To (sr + .Cells((sr - 3), 1).Value - 1)
  41.                     ' ¦pªG­È¬°"ok"¸Ó¦Ccopy ¨ì¥»¦¸ªí®æ.¦pªG­È¬°"ng"«h¤£³B²z
  42.                     If .Cells(again_oi, 5).Value = "OK" Then
  43.                         .Cells(again_ai, 1).Value = .Cells(again_oi, 1).Value
  44.                         .Cells(again_ai, 2).Value = .Cells(again_oi, 2).Value
  45.                         again_ai = again_ai + 1
  46.                     End If
  47.                 Next again_oi
  48.                      
  49.                 ' ±N«e¦¸²Ä¤T¦C¼ÐÃD¦C¼ÐÃD copy ¦Ü¥»¦¸ªí®æ²Ä¤T¦C¼ÐÃD¦C¼ÐÃD
  50.                 again_aj = 1
  51.                 For again_oj = 1 To 12
  52.                     .Cells(angin_sr - 4, again_aj).Value = .Cells(sr - 4, again_oj).Value
  53.                     again_aj = again_aj + 1
  54.                 Next again_oj
  55.                           
  56.                 ' §Q¥ÎÅܼƨD¥X¥»¦¸ªí®æ³Ì«á¦C¼Æ¥Øªº¥Î©ó¨D¥X²Ä¤T¦C¤½¦¡ªº³Ì«á½d³ò
  57.                 xlRow = .Range("B" & angin_sr).End(xlDown).Row
  58.                     
  59.                 chart_end = xlRow
  60.                 ' ­pºâ¥»¦¸ "A3" Àx¦s®æ NO.OF.RESULT­È(¤ÀªR­È®a¼Æ)±q¥»¦¸°_©l¦C¦Ü(angin_sr)¦Ü¥»¦¸³Ì«á¦C¼Æªº¼Æ¶q
  61.                 .Cells(angin_sr - 3, 1).Formula = "=COUNT(B" & angin_sr & ":B" & xlRow & ")"
  62.                 ' ¥»¦¸ "B3" Àx¦s®æ¤ÀªR­È¤¤¶¡­È (MEDIAN)
  63.                 .Cells(angin_sr - 3, 2).Formula = "=MEDIAN(B" & angin_sr & ":B" & xlRow & ")"
  64.                 ' ¥»¦¸ C3 Àx¦s®æ IRQ ´Ó
  65.                 .Cells(angin_sr - 3, 3).Formula = "=(QUARTILE(B" & angin_sr & ":B" & xlRow & ",3) -QUARTILE(B" & angin_sr & ":B" & xlRow & ",1))*0.7413"
  66.                         
  67.                 ' ¥»¦¸ "E3" Àx¦s®æROBUS CV­È
  68.                 .Cells(angin_sr - 3, 5).Formula = "=  C3 / B3 *100"
  69.                 ' ¥»¦¸ "F3" Àx¦s®æ¤ÀªR­È¤¤³Ì¤Ö­È
  70.                 .Cells(angin_sr - 3, 6).Formula = "=MIN(B" & angin_sr & ":B" & xlRow & ")"
  71.                 ' ¥»¦¸ "G3" Àx¦s®æ¤ÀªR­È¤¤³Ì¤j­È
  72.                 .Cells(angin_sr - 3, 7).Formula = "=MAX(B" & angin_sr & ":B" & xlRow & ")"
  73.                 ' ¥»¦¸ "H3" Àx¦s®æRANGE­È
  74.                 .Cells(angin_sr - 3, 8).Formula = "=G3-F3"
  75.                 ' ¥»¦¸©w¸q "I3" Àx¦s®æ¬° E178 ­È
  76.                 .Cells(angin_sr - 3, 9).Value = E178(.Cells(angin_sr - 3, 1).Value)
  77.                 ' ¥»¦¸©w¸q "j3" Àx¦s®æ¬°¤ÀªR­È¥­§¡­È
  78.                 .Cells(angin_sr - 3, 10).Formula = "=AVERAGE(B" & angin_sr & ":B" & xlRow & ")"
  79.                 ' ¥»¦¸©w¸q "k3" Àx¦s®æ¬°stdv
  80.                 .Cells(angin_sr - 3, 11).Formula = "=STDEV(B" & angin_sr & ":B" & xlRow & ")"
  81.                 ' ¥»¦¸ "NG" ®a¼Æ ­È
  82.                 .Cells(angin_sr - 3, 12).Value = NGValue
  83.                 ' ¥»¦¸¼ÐÃD¦C "°õ¦æ²Ä" ¦r¦êª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  84.                 .Cells(angin_sr - 2, 1).Value = .Cells(sr - 2, 1).Value
  85.                 ' ¥»¦¸¼ÐÃD¦CÅã¥Ü²Ä an ¦¸¤ÀªR
  86.                 .Cells(angin_sr - 2, 2).Value = an
  87.                 ' ¥»¦¸¼ÐÃD¦C "ouline" ¦r¦êª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  88.                 .Cells(angin_sr - 2, 3).Value = .Cells(sr - 2, 3).Value
  89.                 ' ¥»¦¸©w¸q¹êÅç«Ç½s¸¹¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  90.                 .Cells(angin_sr - 1, 1).Value = .Cells(sr - 1, 1).Value
  91.                 ' ¥»¦¸©w¸q¹êÅç«Ç¤ÀªR­È¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  92.                 .Cells(angin_sr - 1, 2).Value = .Cells(sr - 1, 2).Value
  93.                 ' ¥»¦¸©w¸qz-score­È¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  94.                 .Cells(angin_sr - 1, 3).Value = .Cells(sr - 1, 3).Value
  95.                 ' ¥»¦¸©w¸qoutline¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  96.                 .Cells(angin_sr - 1, 4).Value = .Cells(sr - 1, 4).Value
  97.                 ' ©w¸q§P©wµ²ªG­È¼ÐÃD¦Cª½±µ±q«e¦¸Àx¦s®æ¦ì¸m copy
  98.                 .Cells(angin_sr - 1, 5).Value = .Cells(sr - 1, 5).Value
  99.                 ' ¥»¦¸ "C" Äæ Z-SCORE ­È­pºâ
  100.                 .Range("C" & angin_sr & " :C" & xlRow).Formula = "=(b" & angin_sr & "-$B$" & angin_sr - 3 & ") /$C$" & angin_sr - 3
  101.                 ' ¥»¦¸ "D" Äæ OUTLINE ­È­pºâ
  102.                 .Range("d" & angin_sr & " :d" & xlRow).Formula = "= (B" & angin_sr & " -$J$" & angin_sr - 3 & ")/$K$" & angin_sr - 3
  103.                        
  104.                 ' ¥»¦¸ "E' Äæ§P§O OUTLINE,  true="ok"  FALSE="NG"
  105.                 ' "NG"®a¼Æ°_©l­È ,¥Øªº"±N¦³"ng"®a¼Æ°O¿ý¦b"L3"Äæ¦ì¥Î©ó¬O§_Ä~Äò§P§O OUTLINE
  106.                        
  107.                 .Range("L" & angin_sr - 3).Value = 0
  108.                           
  109.                 ' ¶}©l§P§O±q¥»¦¸°_©l¦C¶}©l
  110.                 ' again_ai = angin_sr
  111.                              
  112.                 ' For again_ai = again_ai To ((angin_sr) + .Range("A" & angin_sr - 3).Value - 1)
  113.                 For again_ai = angin_sr To ((angin_sr) + .Range("A" & angin_sr - 3).Value - 1)
  114.                     ' ¤ñ¹ï D6 ¬O§_ < E178 ­È (I3) Äæ
  115.                     If .Range("D" & again_ai).Value < .Range("I" & angin_sr - 3).Value Then
  116.                         ' ­È = TRUE ®É E Äæ°O¿ý "OK"
  117.                         .Range("E" & again_ai).Value = "OK"
  118.                     Else
  119.                         ' ­È = FLACE®ÉEÄæ°O¿ý "NG"
  120.                         .Range("E" & again_ai).Value = "NG"
  121.                         ' ³] "NG" FONT.COLOR ¬°¬õ¦â
  122.                         .Range("E" & again_ai).Font.Color = vbRed
  123.                         ' "NG" ®a¼Æ + 1
  124.                         .Range("L" & angin_sr - 3).Value = .Range("L" & angin_sr - 3).Value + 1
  125.                     End If
  126.                 Next again_ai
  127.                                  
  128.                 ' ¦pªGÁÙ¦³ "NG" ­ÈÄ~Äò°õ¦æ OUTLINE
  129.                 ' ±N¥»¦¸ªí®æ¦C¼Æ­È³]©wµ¹¤W¦¸ªí®æ¦C¼Æ¥Øªº±N¥»¦¸ªí®æ¦C¼Æ§@¬°¤U¦¸ªí®æ­pºâ°ò¦
  130.                 sr = angin_sr
  131.             Loop
  132.                
  133.             ' ********¦¹³B¬°.Cells((sr - 3), 12).Value =0."NG" ®a¼Æ=0 ¥þ³¡""¥i°õ ¦æZ-SCORE
  134.             ' ©w¸qz_sr¬°z_score°_©lªí®æ¦C
  135.             angin_sr = sr ' ±N sr ­È¦^´pµ¹ angin_sr ¥Øªº¬°§â³Ì«á¤@¦¸ outline "sr=angin_sr" ¦^´p¦^¨Ó
  136.             sr = 6        ' ±Nsr¦^´p¨ì²Ä¤@¦¸ªí®æ°_©l¦ì¸m
  137.                   
  138.             ' z_sr = °õ¦æ z-score °_©l¦C¬°: ³Ì«á¤@¦¸°_©l¦C¼Æ + ³Ì«á¤ÀªR®a¼Æ + 6 ®æªÅ®æ
  139.             z_sr = angin_sr + (.Cells((angin_sr - 3), 1).Value + 6)
  140.                   
  141.             ' ³]©w¤¸¯À z_score ¼ÐÃD¦C¼ÐÃD (z_score ªº²Ä¤T¦C)
  142.             .Cells((z_sr - 2), 1).Value = "°õ¦æ"
  143.             .Cells((z_sr - 2), 2).Value = .Name
  144.             .Cells((z_sr - 2), 3).Value = "z_score"
  145.                   
  146.             ' ±N²Ä¤@¦¸ªí®æ "¹êÅç«Ç½s¸¹" (²Ä¤@¦æ¸¹)»P "¤ÀªR­È" (²Ä¤G¦æ) copy ¦Ü z_score ªí®æ¦]¬°­n¥þ³¡ "¹êÅç«Ç½s¸¹" »P "¤ÀªR­È"
  147.                        
  148.             z_oi = sr                      ' z_oi ©w¸q¬° ²Ä¤@¦¸ °_©l®æªí®æ¶}©l­p¼Æ
  149.             z_ai = z_sr                    ' z_ai ©w¸q¬° z_score °_©lªí®æ¶}©l­p¼Æ
  150.                  
  151.             For z_oi = z_oi To sr + .Cells((sr - 3), 1).Value
  152.                 .Cells(z_ai, 1).Value = .Cells(z_oi, 1).Value
  153.                 .Cells(z_ai, 2).Value = .Cells(z_oi, 2).Value
  154.                 z_ai = z_ai + 1
  155.             Next z_oi
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD