- ©«¤l
- 472
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 485
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- MS Office
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-7-4
- ³Ì«áµn¿ý
- 2014-12-28
|
´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 |
|