ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] VBA¤¤ªº¨ç¼Æ¦¡ ¨ú¥N

¦^´_ 10# PJChen
Àx¦s®æ¤½¦¡¤¤E3="",­n¼g¦¨E3=""""

1) µLªk°õ¦æ
xRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("E3:E" & xRow).Formula = "=IF(E3="""",""µL¥æ³f"",T3&S3&R3)"
2)µLªk°õ¦æ
Range("Z3:Z" & xRow).Formula = "=IF(AB3="""","""",AB3-Y3)"

3) µLªk°õ¦æ
Range("F2:F" & xRow).Formula = "=IF(MONTH(A3)<>MONTH(A4),SUM(INDIRECT(ADDRESS(MATCH(DATE(YEAR(A3),MONTH(A3),1),A:A,0),COLUMN(D3),3)):D3),"""")"

TOP

¦^´_ 11# jcchiang

­ì¨Ó¬O¥X¦bÂù¤Þ¸¹,·PÁÂ,,,§Ú¦A¸Õ¸Õ

TOP

Sub ¤½¦¡_01()
Dim xR As Range, xH As Range, xA As Range, C%, N&
Set xR = [C5] '²Ä¤@°Ï©w¦ì®æ
C = Application.Match("¦X­p", Rows(4), 0) - xR.Column  'Äæ¦ì¼Æ
Set xA = xR.Resize(7, C) '²Ä¤@°Ï(¤£§t¦X­pÄæ)
Application.ScreenUpdating = False
xA = "=IF(C4=0,"""",INT(C4/$C$3)&""½c""&TEXT(MOD(C4,$C$3),""+0;;;""))"
xA.Rows(1) = "=SUMPRODUCT((­¸¤ñ!$F$4:$F$70=$B$3)*(­¸¤ñ!$AP$3:$BH$3=C4)*(­¸¤ñ!$AP$4:$BH$70))"
xA.Rows(3) = "=SUMPRODUCT((­¸¤ñ!$F$4:$F$70=$B$3)*(­¸¤ñ!$BJ$3:$CB$3=C4)*(­¸¤ñ!$BJ$4:$CB$70))"
xA.Rows(5) = "=SUMPRODUCT((­¸¤ñ!$F$4:$F$70=$B$3)*(­¸¤ñ!$CD$3:$CV$3=C4)*(­¸¤ñ!$CD$4:$CV$70))"
xA.Rows(6) = "=SUMPRODUCT((­¸¤ñ!$F$4:$F$70=$B$3)*(­¸¤ñ!$CX$3:$DP$3=C4)*(­¸¤ñ!$CX$4:$DP$70))"
xR(1, C + 1).Resize(7) = "=IF($B5=""½c+²~"","""",SUM(" & xA.Rows(1).Address(0, 0) & "))" '¦X­pÄæ
'-----------------------------------------------
Set xA = xR.Resize(7, C + 1) '²Ä¤@°Ï(§t¦X­pÄæ)
Do
    N = N + 1: Set xH = xR(N * 9 + 1, 1)
    If xH(1, 0) <> "­qÁʼÆ" Then Exit Do
    With xH.Resize(7, C + 1)
         xA.Copy .Cells
         .Value = .Value
    End With
Loop
xA.Value = xA.Value
End Sub

Xl0000048.rar (35.95 KB)

======================================

TOP

¦^´_ 13# ­ã´£³¡ªL

·PÁ­ã¤jÀ°§Ú°_¤F¤@­ÓÀY,¥Ñ©ó¾ã­Ó¬d±b¤º®eÁÙ¤£§¹¾ã,³Ñ¾lªº¸ê®Æ,§Ú¦A¬Ý¬Ý¯à§_¨Ì¼Ëµe¸¬Äªµ¹¸É¤W~~ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD