Dim mSht As Worksheet
Dim mRng As Range, mRng1 As Range
Dim s%
Set mSht = ActiveSheet
With mSht
Set mRng1 = .Range("a2", .Range("a" & .Rows.Count).End(xlUp))
For Each mRng In mRng1
If mRng.Interior.ColorIndex = 5 Then '儲存格顏色
'If mRng.Font.ColorIndex = 5 Then '儲存格字型顏色
s = s + 1
End If
Next
If s > 0 Then
.Range("a1") = "藍色儲存格合計 :" & s
End If
End With
End Sub作者: Hsieh 時間: 2013-8-22 08:40
Dim mSht As Worksheet
Dim mRng As Range, mRng1 As Range
Dim s%
Set mSht = acitvesheet
With mSht
Set mRng1 = .Range("a2", .Range("a" & .Rows.Count).End(xlUp))
For Each mRng In mRng1
If mRng.Value > 100 Then
s = s + 1
End If
Next
.Range("c1") = "符合格式條件合計 :" & s
End With
End Sub作者: wwh126 時間: 2013-8-24 13:21