|
Sub hz()
Dim i, j, k, irow, irow1 As Integer
Dim ar, br As Variant
irow = Sheets("主要工程量分图统计").[a65536].End(xlUp).Row
ar = Sheets("主要工程量分图统计").Range("a1:q" & irow)
irow1 = Sheets("粘贴部分").[a65536].End(xlUp).Row
br = Sheets("粘贴部分").Range("a1:q" & irow1)
For i = 2 To irow
For j = 2 To irow1
If ar(i, 2) = br(j, 2) And ar(i, 3) = br(j, 3) Then
Sheets("粘贴部分").Cells(j, 2).Interior.Color = vbGreen
Sheets("主要工程量分图统计").Cells(i, 2).Interior.Color = vbGreen
For k = 6 To 17
Sheets("主要工程量分图统计").Cells(i, k) = ar(i, k) + br(j, k)
Next
End If
Next
Next
MsgBox "ok"
End Sub |
评分
-
1
查看全部评分
-
|