- 帖子
- 586
- 主題
- 123
- 精華
- 0
- 積分
- 763
- 點名
- 0
- 作業系統
- WINDOW7
- 軟體版本
- Office 2003
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2010-5-16
- 最後登錄
- 2017-3-14
 
|
15#
發表於 2011-6-1 22:00
| 只看該作者
回復 14# GBKEE
表達上可能有些不清楚
不過大大的方式我改過已經是我要的
只是不知道我這樣改事不是最佳的方式
附上我要的完成品
又學到新東西
謝謝- Sub up()
- Application.ScreenUpdating = False
- Dim Rng As Range, X As Range, R As Range, Tolta%, A%, i%, ii%
- With Cells
- .Interior.ColorIndex = xlNone
- .Font.ColorIndex = 0
- .Font.Bold = False
- End With
- Set Rng = Range("C5:AD" & [A65536].End(xlUp).Row)
- For Each R In Rng.Rows
- Set Rng = R.Cells(1)
- A = 0
- Set Rng = R.Cells(1, 0).End(xlToRight)
- Rng.Interior.ColorIndex = 0
- Y = [iv4].End(xlToLeft).Column - 1
- For ii = 2 To 28
- If R.Cells(1, ii) <> "" And Rng < R.Cells(1, ii) Then
- Set Rng = R.Cells(1, ii)
- With R.Cells(1, ii).Font
- .ColorIndex = 7
- .Bold = True
- End With
- A = A + 1
- With R.Cells(1, Y)
- .Value = A
- .Interior.ColorIndex = 4
- End With
- ElseIf R.Cells(1, ii) <> "" And Rng > R.Cells(1, ii) Then
- Set Rng = R.Cells(1, ii)
- End If
- Next
- Next
- End Sub
複製代碼
統計顏色.rar (10.83 KB)
|
|