- 帖子
- 248
- 主題
- 55
- 精華
- 0
- 積分
- 314
- 點名
- 110
- 作業系統
- XP / WIN7
- 軟體版本
- 2003 / 2007
- 閱讀權限
- 20
- 性別
- 男
- 來自
- Tainan
- 註冊時間
- 2013-10-18
- 最後登錄
- 2025-6-3
            
|
回復 8# stillfish00
不知道為什麼執行起來會說巨集有問題
重開了也是一樣
不清楚錯在哪
我的執行方式是- Sub test()
- SetRangeFlashing Target:=Range("B2"), ColorIndex:=3
- End Sub
- Static Sub SetRangeFlashing(Optional Target, Optional ColorIndex, Optional bQuit As Boolean)
-
- '使用方法:
- ' 要開始閃爍請呼叫:
- 'SetRangeFlashing Target:=Range("B2"), ColorIndex:=3
- ' 要停止閃爍請呼叫:SetRangeFlashing bQuit:=True
- Dim dteNextTime As Date
- Dim bStatus As Boolean
- Dim RecordColor
- Dim rngFlash As Range
-
- If bQuit Then
- rngFlash.Interior.ColorIndex = RecordColor
- Application.OnTime dteNextTime, "SetRangeFlashing", , False
- Else
- If Not IsMissing(Target) Then Set rngFlash = Target
- If Not IsMissing(ColorIndex) Then RecordColor = ColorIndex
-
- rngFlash.Interior.ColorIndex = IIf(bStatus, RecordColor, xlColorIndexNone)
- bStatus = Not bStatus
- dteNextTime = Now + TimeValue("00:00:01")
- Application.OnTime dteNextTime, "SetRangeFlashing"
- End If
-
- End Sub
複製代碼 不知道這樣跑程式是不是正確的
麻煩大大幫我看看
謝謝 : ) |
|