- 帖子
- 835
- 主題
- 6
- 精華
- 0
- 積分
- 915
- 點名
- 0
- 作業系統
- Win 10,7
- 軟體版本
- 2019,2013,2003
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2010-5-3
- 最後登錄
- 2024-11-14
|
5#
發表於 2013-8-2 23:59
| 只看該作者
本帖最後由 luhpro 於 2013-8-3 00:01 編輯
回復 4# t8899
因為沒實際的檔案資料可以驗證結果,
試試看底下的程式碼是否符合你的需求.- Dim sStr$
- Dim xx As Range
- sStr = ""
- For Each xx In Range("AG2:AG111")
- If Not IsError(xx) Then
- If xx > xx.Offset(, -1) And Range("Q24").Value = 1 And flag = True Then
- If sStr <> "" Then sStr = sStr & Chr(10)
- sStr = sStr & "===> " & Cells(xx.Row, 2).Value & "=====> " & xx.Value
- Range("Q24").Value = 2
- Application.OnTime Now + TimeValue("00:00:15"), "DDD"
- Exit For
- End If
- End If
- Next
- If sStr <> "" Then CreateObject("Wscript.shell").Popup sStr, 1, "Auto Closed MsgBox", 64
複製代碼 |
|