¥»©«³Ì«á¥Ñ freeffly ©ó 2013-6-19 15:51 ½s¿è
1.¤½¦¡¤£¦P¦p¤U¦pªG¶ñº¡°Ê§@¤@¼Ë¦³¿ìªk²¤Æ¶Ü
2.¤½¦¡¬Û¦P¤£³sÄò¶ñº¡ªº°Ê§@¤@¼Ë¯à²¤Æ¶Ü(v7 v14 v16 v18 ¤½¦¡¬Û¦P)
´¿¸g¤Ñ¯uªº·Q¥Îunion+arrayªº¤è¦¡³B²z
µo²{¤£¦æ¡A¤£ª¾¹D¦³¨S¦³¤H¦³¦n¤èªk²²¤¤U±ªº¥N½X- Sub ¾P³f¤½¦¡()
- Application.ScreenUpdating = False
- nC = Sheets("¾P³f").Range("A4").End(xlToRight).Offset(, 1).Column
- nR = Sheets("¾P³f").Range("A65536").End(xlUp).Row
- nC1 = Sheets("¾P³f").Range("A4").End(xlToRight).Offset(, 1).Column - 2
- x = [iv1].End(xlToLeft).Column - 21
-
-
- With Sheets("¥þ³¡")
- With .Range("V2")
- .FormulaR1C1 = _
- "=GETPIVOTDATA(""¥»¹ô¾P³fª÷ÃB"",¾P³f!R3C1,""¤ë¥÷"",R1C)"
- .AutoFill .Resize(1, x)
- End With
- With .Range("V9")
- .FormulaR1C1 = _
- "=SUMPRODUCT((¾P³f!R5C" & nC & ":R" & nR & "C" & nC & "=""Àç·~½Ò"")*(¾P³f!R4C3:R4C" & nC1 & "=R1C),¾P³f!R5C3:R" & nR & "C" & nC1 & ")"
- .AutoFill .Resize(1, x)
- End With
-
- With .Range("V4")
- .FormulaR1C1 = "=GETPIVOTDATA(""¦Xp¥¼¦¬±b´Ú"",±bÄÖ!R1C1,""¤ë¥÷"",R1C)"
- .AutoFill .Resize(1, x)
- End With
- With .Range("V7")
- .FormulaR1C1 = "=VLOOKUP(R1C20,³æÀY¸ê®Æ!C1:C45,45,0)"
- .AutoFill .Resize(1, x)
- End With
-
- With .Range("V14")
- .FormulaR1C1 = "=VLOOKUP(R1C20,³æÀY¸ê®Æ!C1:C45,45,0)"
- .AutoFill .Resize(1, x)
- End With
-
- With .Range("V16")
- .FormulaR1C1 = "=R[-14]C-R[-7]C"
- .AutoFill .Resize(1, x)
- End With
- With .Range("V18")
- .FormulaR1C1 = "=R[-14]C-R[-7]C"
- .AutoFill .Resize(1, x)
- End With
- With .Range("V21")
- .FormulaR1C1 = "=VLOOKUP(R1C20,³æÀY¸ê®Æ!C1:C45,45,0)"
- .AutoFill .Resize(1, x)
- End With
- end with
- End Sub
½Æ»s¥N½X |