我有一個總進度表裡面包含各個案子標案型態和金額
想在另一個表中直接呈現總進度
但在執行時卻一直出現型態不符合
實在找不出是哪個變數的型態有誤
要請各位高手幫眼殘小女檢查
感謝
Sub 請款進度2()
Dim a, b, c As Range
Dim rcnt As Long, i As Integer
Dim numerator As Double, denominator As Double
numerator = 0
denominator = 0
rcnt = Sheets("總進度").Range("D6").End(xlToRight).Column
For i = 4 To rcnt
Set a = Sheets("總進度").Cells(6, i)
Set b = Sheets("總進度").Cells(11, i)
Set c = Sheets("總進度").Cells(12, i)
If a.Interior.Color = Range("D4").Interior.Color Then
numerator = numerator + b.Value
denominator = denominator + c.Value
End If
Next i
Range("M5").Value = numerator
Range("M6").Value = denominator
End Sub