Sub AA()
Z = Sheet1.[A65536].End(xlUp).Row
For ZZ = 2 To Z
For X = 1 To 48
For Y = 1 To 1000
If Sheet1.Cells(ZZ, 1) = Sheet2.Cells(Y, X) Then
Sheet1.Cells(ZZ, 4) = Sheet2.Cells(1, X)
End If
Next
Next
Next
End Sub作者: adam2010 時間: 2015-6-17 18:13
改成這樣OK了~ 謝謝rouber590324
Sub AA()
z = Sheets("sheet1").Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
For ZZ = 2 To z
For X = 1 To 48
For Y = 1 To 1000
If Sheets("sheet1").Cells(ZZ, 1) = Sheets("sheet2").Cells(Y, X) Then
Sheets("sheet1").Cells(ZZ, 4) = Sheets("sheet2").Cells(1, X)
End If
Next
Next
Next
End Sub