¥H¤Uµ{¦¡½X¡A¥Ø«e¤p§Ì¬O¥H°j°é¤è¦¡³]p¡A·í¸ê®Æ¤j®É¶]ªº³t«×¦³ÂI¤[¡A¤£ª¾¦³¨ä¦³¿ìªk¦A²¤Æ©Î¨ä¥L¤è¦¡°õ¦æ??
sub aa()
Dim sht As Worksheet
For mon = 1 To 12
Application.EnableEvents = False
For Each sht In Worksheets
col = Sheets(mon & "¤ë¥¼µ²").Range("A1").End(xlToRight).Column
r = Sheets(mon & "¤ë¥¼µ²").Range("AA1").Value
For x = 7 To col
For y = 2 To r
mony = Application.IfError(Application.VLookup(Sheets(mon & "¤ë¥¼µ²").Range("A" & y), Sheets("" & sht.Name).Range("A:U"), Application.Match(Sheets("" & sht.Name).Cells(1, x),
Sheets("" & sht.Name).Range("A1:U1"), 0), 0), "")
Sheets(mon & "¤ë¥¼µ²").Cells(y, x) = mony
Next
Next
End If
Next
Application.EnableEvents = True
Next mon
end sub |