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

[µo°Ý] §PÂ_¸ê®Æ¬O§_§eÄmÁͶÕ

[µo°Ý] §PÂ_¸ê®Æ¬O§_§eÄmÁͶÕ

¥»©«³Ì«á¥Ñ smooth131 ©ó 2011-8-25 00:12 ½s¿è

µ{¦¡¥Øªº¡j
Àˬd¸ê®ÆÄæ¦ì¡A­Y¬O¸ê®Æ³sÄò¡]·í>num®É¡^»¼¼Wor»¼´î¡A´N¥X²{¡u¤@¦¸¡vmsgbox

¡i°ÝÃD´y­z¡j
(1) ¦b¿ï©wªº¸ê®ÆÄ椤¡A¥u­n¨ä¤¤¦³¤C²Õ¼Æ¾Ú¡]¥i¯à¬O¦b¸s²Õªº¥ô¦ó¤@­Ó°Ï¬q¡^¬O¦³¼W¥[or´î¤Öªº²{¹³´N·|¥X²{msgbox
     ·Q¤F«Ü¤[ÁÙ¬O¤£ª¾¹D«ç»ò¤~¯àÅý¥¦§PÂ_"³sÄò"
(2) msgbox¥X²{ªº¦¸¼Æ¤£¤î¤@¦¸

¡iµ{¦¡½X¡j
Sub WrongTrend()

Dim RowNum As Integer, num As Integer
num = 7
ActiveSheet.Select
Range(Cells.Find("X-bar").Offset(1, 0), Cells.Find("X-bar").Offset(1, 0).End(xlDown)).Select
RowNum = Selection.CountLarge

For i = 1 To (RowNum - 1)
    If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
        k = k + 1
        'Sheets("sheet2").Cells(i, 1).Value = k
        If k > num Then
            MsgBox "¼Ë¥»§e»¼¼W²{¶H", , "»sµ{²§±`"
            k = 0
        End If
    ElseIf Cells(i, 1).Value > Cells(i + 1, 1).Value Then
        k = k + 1
        'Sheets("sheet2").Cells(i, 1).Value = k
        If k > num Then
            MsgBox "¼Ë¥»§e»¼´î²{¶H", , "»sµ{²§±`"
            k = 0
        End If
    Else
        k = 0
    End If
Next

End Sub
wrong.rar (8.93 KB)
·PÁ±z­@¤ßªº¾\Ū    m(-_-)m

´N¬O¦³¥ô¦óMSGBOX¥X²{´N°±¤îÀˬd?
³Ì²³æªº¸Ü¥i¥H¦bMSGBOX«á¥[¤WEXIT SUB

'¥Ø«e¬OnumÁ`¼Æ>7¡A¦Ó«D³sÄò7­Ónum
Sub WrongTrend()

Dim RowNum As Integer, num As Integer
num = 7
ActiveSheet.Select
Range(Cells(1, 1), Cells(1, 1).End(xlDown)).Select
RowNum = Selection.CountLarge

For i = 1 To (RowNum - 1)
    If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
        k = k + 1
        'Sheets("sheet2").Cells(i, 1).Value = k
        If k > num Then
            MsgBox "¼Ë¥»§e»¼¼W²{¶H", , "»sµ{²§±`"
            k = 0
            Exit Sub
        End If
    ElseIf Cells(i, 1).Value > Cells(i + 1, 1).Value Then
        k = k + 1
        'Sheets("sheet2").Cells(i, 1).Value = k
        If k > num Then
            MsgBox "¼Ë¥»§e»¼´î²{¶H", , "»sµ{²§±`"
            k = 0
            Exit Sub
        End If
    Else
        k = 0
    End If
Next
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¯u±o­C~~~~~¬O§Ú·Q±o¤Ó½ÆÂøªº¡Aµ²ªG·U¼g·U½ÆÂø
·PÁ±zªº´£¿ô  m(-_-)m

TOP

¨Ì´`³o­Ó¥DÃD¦A°Ý¤@¦¸¡A¨º¦pªGµ{¦¡§ï¦¨³o¼Ë¡]½Ð°Ñ·Óªþ¥óÀɤ¤ªºSub WrongTrend¡^ control_chart request.rar (33.35 KB)

¬°¤°»ò©ú©ú¨S¦³»¼´î²{¶H¡A«o·|¤@ª½¥X²{»¼´îªºmsgbox

·PÁ±zªº¦^µª

µ{¦¡½X¦p¤U©Ò¥Ü¡A·s¤â½Ð¦h¥]²[  m(-_-)m
  1. Sub WrongTrend()

  2. Dim RowNum As Integer, num As Integer
  3. num = 7
  4. Sheets("Xbar-R").Select
  5. Range(Cells.Find("X-bar").Offset(1, 0), Cells.Find("X-bar").Offset(1, 0).End(xlDown)).Select
  6. RowNum = Selection.CountLarge

  7. For i = 1 To (RowNum - 1)
  8.     If Cells(i + 3, 7).Value < Cells(i + 4, 7).Value Then
  9.         k = k + 1
  10.         If k > num Then
  11.             MsgBox "¼Ë¥»§e»¼¼W²{¶H", , "»sµ{²§±`"
  12.             k = 0
  13.             Exit Sub
  14.         End If
  15.     ElseIf Cells(i + 3, 7).Value > Cells(i + 4, 7).Value Then
  16.         k = k + 1
  17.         If k > num Then
  18.             MsgBox "¼Ë¥»§e»¼´î²{¶H", , "»sµ{²§±`"
  19.             k = 0
  20.             Exit Sub
  21.         End If
  22.     Else
  23.         k = 0
  24.     End If
  25. Next

  26. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD