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

[µo°Ý] §PÂ_¸ê®Æ¬O§_§eÄ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

        ÀR«ä¦Û¦b : ¦a¤WºØ¤Fµæ¡A´N¤£©öªø¯ó¡F¤ß¤¤¦³µ½¡A´N¤£©ö¥Í´c¡C
ªð¦^¦Cªí ¤W¤@¥DÃD