|
▼初心者 さん:
範囲を変数に入れておいて、ColorIndex を調べたらどうでしょ
> '●別シートに集計内容出力(部課計)
>
Dim r As Range '●追加
> Dim vnt, A
> Dim dic As Object
>
> '
> With Sheets("作業")
Set r = .Range("Z2", .Range("A65536").End(xlUp))
vnt = r.Value
> End With
> '
> Set dic = CreateObject("Scripting.Dictionary")
> For i = 1 To UBound(vnt, 1)
> If Not dic.exists(vnt(i, 9)) Then
> ReDim A(11)
> A(0) = vnt(i, 9)
> A(4) = vnt(i, 4)
> A(7) = vnt(i, 22)
> A(8) = wk2
> A(9) = wk3
> Else
> A = dic(vnt(i, 9))
> End If
>
> A(1) = A(1) + vnt(i, 17)
> A(3) = A(3) + vnt(i, 19)
> A(5) = A(5) + vnt(i, 20)
> A(6) = A(6) + vnt(i, 21)
>
> '★ここの箇所のように色の条件付けをしたい。'
If r(i, 12).Interior.Color <> 15773696 Then
> A(2) = A(2) + vnt(i, 12)
> End If
> dic(vnt(i, 9)) = A
> Next i
|
|