- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
Option Explicit
Sub ¤pp()
Call ¥þ³¡Åã¥Ü
Call ±Æ§Ç
Dim Er&, Arr(), Brr(), i, xF, xE
[AS:AS].ClearContents
[AS13] = "¤ë_¾÷ºØ_«~¦W_®Æ¸¹"
Er = ActiveSheet.UsedRange.Rows.Count
If Range("A" & Er) = "¥ªÁäÂù«ö§R°£¦¹¦C" Then
Rows(Er).Delete
Er = ActiveSheet.UsedRange.Rows.Count
End If
Arr = Range([A1], Range("AO" & Er))
ReDim Brr(1 To Er - 13)
For i = 14 To UBound(Arr)
Cells(i, 45) = Format(Cells(i, 37), "yyyy/mm") & "_¾÷ºØ:" & Cells(i, 5) & "_«~¦W:" & Cells(i, 9) & "_®Æ¸¹:" & Cells(i, 13)
Next
Range("E13:AS" & ActiveSheet.UsedRange.Rows.Count).Subtotal GroupBy:=41, Function:=xlSum, TotalList:=Array(21, 25, _
29), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Cells.ClearOutline ' §R¤jºõ
xE = ""
For i = 14 To ActiveSheet.UsedRange.Rows.Count
xF = Cells(i, "AS")
If xF Like "*¦Xp*" = True Then
Cells(i - 1, "U").Interior.ColorIndex = 35
End If
If xF Like "*p*" = True Then
Rows(i).Interior.ColorIndex = 36
Rows(i).Value = Rows(i).Value
GoTo 9999
End If
If xF <> xE Then
If Cells(i, "Q") = "" Then
Cells(i, "Q").Interior.ColorIndex = 3
MsgBox Cells(i, "AS") & "¨S¦³¤W¤ë®w¦s¸ê®Æ!" & Chr(10) & Chr(10) & _
"°õ¦æ¤¤Â_! ½Ð×¥¿«á¦A«·s°õ¦æ!"
ActiveWindow.ScrollRow = i - 10
Exit Sub
End If
Cells(i, "U") = ""
Cells(i, "U") = Cells(i, "Q") + Cells(i, "Y") - Cells(i, "AC") + Cells(i, "AG")
xE = Cells(i, "AS")
Else
Cells(i, "Q") = ""
Cells(i, "U") = Cells(i - 1, "U") + Cells(i, "Q") + Cells(i, "Y") - Cells(i, "AC") + Cells(i, "AG")
Cells(i, "U").Interior.ColorIndex = xlNone
End If
9999
Next
End Sub
Option Explicit
Sub ¤pp_ERR()
Call ¥þ³¡Åã¥Ü
Call ±Æ§Ç
Dim Er&, Arr(), Brr(), i, xF, xE
[AS:AS].ClearContents
[AS13] = "¤ë_¾÷ºØ_«~¦W_®Æ¸¹"
Er = ActiveSheet.UsedRange.Rows.Count
If Range("A" & Er) = "¥ªÁäÂù«ö§R°£¦¹¦C" Then
Rows(Er).Delete
Er = ActiveSheet.UsedRange.Rows.Count
End If
Arr = Range([A1], Range("AO" & Er))
ReDim Brr(1 To Er - 13)
For i = 14 To UBound(Arr)
Brr(i - 13) = Format(Cells(i, 37), "yyyy/mm") & "_¾÷ºØ:" & Arr(i, 5) & "_«~¦W:" & Arr(i, 9) & "_®Æ¸¹:" & Arr(i, 13)
Next
[AS14].Resize(UBound(Brr)) = Brr
Range("E13:AS" & ActiveSheet.UsedRange.Rows.Count).Subtotal GroupBy:=41, Function:=xlSum, TotalList:=Array(21, 25, _
29), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Cells.ClearOutline ' §R¤jºõ
xE = ""
For i = 14 To ActiveSheet.UsedRange.Rows.Count
xF = Cells(i, "AS")
If xF Like "*¦Xp*" = True Then
Cells(i - 1, "U").Interior.ColorIndex = 35
End If
If xF Like "*p*" = True Then
Rows(i).Interior.ColorIndex = 36
Rows(i).Value = Rows(i).Value
GoTo 9999
End If
If xF <> xE Then
If Cells(i, "Q") = "" Then
Cells(i, "Q").Interior.ColorIndex = 3
MsgBox Cells(i, "AS") & "¨S¦³¤W¤ë®w¦s¸ê®Æ!" & Chr(10) & Chr(10) & _
"°õ¦æ¤¤Â_! ½Ð×¥¿«á¦A«·s°õ¦æ!"
ActiveWindow.ScrollRow = i - 10
Exit Sub
End If
Cells(i, "U") = ""
Cells(i, "U") = Cells(i, "Q") + Cells(i, "Y") - Cells(i, "AC") + Cells(i, "AG")
xE = Cells(i, "AS")
Else
Cells(i, "Q") = ""
Cells(i, "U") = Cells(i - 1, "U") + Cells(i, "Q") + Cells(i, "Y") - Cells(i, "AC") + Cells(i, "AG")
Cells(i, "U").Interior.ColorIndex = xlNone
End If
9999
Next
End Sub |
|