- 帖子
- 396
- 主題
- 12
- 精華
- 0
- 積分
- 425
- 點名
- 0
- 作業系統
- Win10
- 軟體版本
- Office 2016
- 閱讀權限
- 20
- 性別
- 男
- 來自
- 台中
- 註冊時間
- 2013-7-2
- 最後登錄
- 2024-8-23
  
|
2#
發表於 2014-7-19 16:16
| 只看該作者
回復 1# vesperlee
為什麼要排斥迴圈~~- Sub TEST_1()
- For Each rg In [b2:g14]
- If rg >= 1000 Then
- rg.Interior.ColorIndex = 8
- ElseIf rg >= 600 Then
- rg.Interior.ColorIndex = 7
- ElseIf rg >= 300 Then
- rg.Interior.ColorIndex = 6
- ElseIf rg >= 100 Then
- rg.Interior.ColorIndex = 5
- ElseIf rg > 0 Then
- rg.Interior.ColorIndex = 4
- ElseIf rg <= -1000 Then
- rg.Interior.ColorIndex = 24
- ElseIf rg <= -600 Then
- rg.Interior.ColorIndex = 23
- ElseIf rg <= -300 Then
- rg.Interior.ColorIndex = 22
- ElseIf rg <= -100 Then
- rg.Interior.ColorIndex = 21
- ElseIf rg < 0 Then
- rg.Interior.ColorIndex = 20
- Else: rg.Interior.ColorIndex = 0
- End If
- Next
- End Sub
複製代碼 |
|