- ©«¤l
- 759
- ¥DÃD
- 249
- ºëµØ
- 0
- ¿n¤À
- 1021
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 11
- ³nÅ骩¥»
- OFFICE2021
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-5-30
- ³Ì«áµn¿ý
- 2024-11-15
|
¦^´_ t8899
¬Ý¤£À´§A¦A°Ý¤°»ò
stillfish00 µoªí©ó 2013-8-21 11:35
«¬ºA¤£²Å¦X????????????
Private Declare Function MsgBoxTest Lib "user32" Alias "MessageBoxTimeoutA" ( _
ByVal hwnd As Long, _
ByVal lpText As String, _
ByVal lpCaption As String, _
ByVal wType As VbMsgBoxStyle, _
ByVal wlange As Long, _
ByVal dwTimeout As Long) As Long
Private Sub Worksheet_Calculate()
Application.DisplayStatusBar = False
Dim sStr$
Dim ZZ As Range
sStr = ""
sStr2 = ""
For Each ZZ In Range("c2:c111")
If Not IsError(ZZ) Then
If Range("R26").Value = 2 Then Range("U26").Value = 1
If Range("Q26").Value = 1 And Range("U26").Value = 1 And flag = True Then
M = Round(ZZ - ZZ.Offset(, 26), 2)
If M >= ZZ.Offset(, 2) Then
If sStr <> "" Then sStr = sStr & Chr(10)
sStr = sStr & "===> " & Cells(ZZ.Row, 2).Value & "=====> " & Round(ZZ - ZZ.Offset(, 26), 2) & "===>" & ZZ.Offset(, 26) & "===>" & ZZ
Application.EnableEvents = False
ZZ.Offset(, 26) = ZZ
Application.EnableEvents = True
End If
If M <= -ZZ.Offset(, 2) Then
If sStr2 <> "" Then sStr2 = sStr2 & Chr(10)
sStr2 = sStr2 & "===> " & Cells(ZZ.Row, 2).Value & "=====> " & Round(ZZ - ZZ.Offset(, 26), 2) & "===>" & ZZ.Offset(, 26) & "===>" & ZZ
Application.EnableEvents = False
ZZ.Offset(, 26) = ZZ
Application.EnableEvents = True
End If
End If
End If
Next
If sStr <> "" Then
MsgBoxTest 0, "", "", sStr, 0, 2500
'----------------
If sStr2 = "" Then
If Range("R26").Value = 1 Then Range("U26").Value = 2
' Range("Q26").Value = 2
' Application.OnTime Now + TimeValue("00:00:15"), "fff"
End If
'----------------------------------------
End If
If sStr2 <> "" Then
MsgBoxTest 0, "", "", sStr2, 0, 2500
If Range("R26").Value = 1 Then Range("U26").Value = 2
End If
end sub |
|