-4
我想幫助在Excel VBA功能改變行背景色爲灰色如果A1值+ D1值= C1值功能在Excel改變行背景色爲灰色如果A1值+ B1值= C1值
和變化它以紅色,如果A1值+ D1值= 0.9 * C1值
我希望它這樣的代碼是工作得很好
Function CountCellsByColor(rData As Range, cellRefColor As Range) As Long
Dim indRefColor As Long
Dim cellCurrent As Range
Dim cntRes As Long
Application.Volatile
cntRes = 0
indRefColor = cellRefColor.Cells(1, 1).Interior.Color
For Each cellCurrent In rData
If indRefColor = cellCurrent.Interior.Color Then
cntRes = cntRes + 1
End If
Next cellCurrent
CountCellsByColor = cntRes
End Function
你爲什麼不嘗試自己寫點東西?您在這裏完成的所有工作都是要求提供代碼併發佈一個非常不相關的功能。回顧你的努力並描述你遇到的任何問題。 –
沒有VBA可以接受嗎? – pnuts
@TimWilliams我現在無法訪問Excel來嘗試,因爲我在旅行回來之後旅行商務旅行,因爲我的時間測試代碼太短了,所以我想要一些代碼來節省我的時間..我希望你能幫助我我 – user3821236