|
Sub copydata()
Dim i As Integer, j As Integer, h As Integer
Dim item As String
j = 2
For i = 2 To Sheets(1).[a65536].End(xlUp).Row
For j = 2 To 7
For h = 2 To 7
'MsgBox Sheets("基础数据").Cells(i, 1)
'MsgBox Sheets("目标").Cells(j, 1)
'MsgBox Sheets("基础数据").Cells(i, 3).Value
'MsgBox Sheets("目标").Cells(1, h)
If Sheets("基础数据").Cells(i, 1) = Sheets("目标").Cells(j, 1) And Sheets("基础数据").Cells(i, 3).Value = Sheets("目标").Cells(1, h) Then
Sheets("目标").Cells(j, h) = Sheets("基础数据").Cells(i, 2).Value & "," + Sheets("目标").Cells(j, h)
End If
Next
Next
Next
End Sub |
|