¥»©«³Ì«á¥Ñ luke ©ó 2012-3-31 23:15 ½s¿è
¦U¦ì¥ý¶i!
§Ú¿ý»s¤F¤AÓ¥¨¶°, ·Ð½Ð¥ý¶i²¤Æ.
Sub Macro1()
Range("A17").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-2]C="""","""",VLOOKUP(R[-2]C,sheet2!R2C1:R[5]C[5],3,0))"
Range("A18").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-3]C="""","""",VLOOKUP(R[-3]C,sheet2!R2C1:R[4]C[5],4,0))"
Range("A19").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-4]C="""","""",VLOOKUP(R[-4]C,sheet2!R2C1:R[3]C[5],5,0))"
Range("A20").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-5]C="""","""",VLOOKUP(R[-5]C,sheet2!R2C1:R[2]C[5],6,0))"
Range("A17:A20").Select
Selection.Copy
Range("a17:K20").Select
ActiveSheet.Paste
Range("a24:K27").Select
ActiveSheet.Paste
Range("a31:K34").Select
ActiveSheet.Paste
Range("a38:K41").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub |