- ©«¤l
- 2833
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2889
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-17
|
ÂŦⳡ¥÷¬Oקï©Î·s¼Wªº³¡¥÷!!!
Sub «È¤áqÁʪí_¿é¥X()
Dim R&, CN&, Arr, Brr, Crr, Drr, QQ, i&, j%, N&, xE As Range, X%, Mch, xNum&, pNo$
R = [F65536].End(xlUp).Row
CN = Application.Count(Range("G4:G" & R))
If CN = 0 Then MsgBox "**©|¥¼¿é¤J¼Æ¶q! ": Exit Sub
If [a2] = "" Then MsgBox "**©|¥¼¿é¤J«È¤á¦WºÙ! ": Exit Sub
If Not IsDate([A4]) Then MsgBox "**¤é´ÁªÅ¥Õ©Î¿ù»~! ": Exit Sub
'------------------------------------
xNum = [o2] '³æ¸¹
If Not xNum Like String(10, "#") Then MsgBox "**³æ¸¹¿ù»~©ÎªÅ¥Õ! ": Exit Sub
If Left(xNum, 7) <> Year([A4]) - 1911 & Format([A4], "mmdd") Then MsgBox "**³æ¸¹«e¢¶½X»P¤é´Á¤£¬Û²Å! ": Exit Sub
'///2021.07.13¼W×////////////////////////////
Mch = Application.Match(xNum, [q³f©ú²Óªí!J:J], 0) 'Àˬd³æ¸¹¬O§_¤w¦s¦b
If [n5] <> "ק襤" Then
If IsNumeric(Mch) Then MsgBox "**³æ¸¹¤w¦s¦b! ": Exit Sub
NM = [a2] '«È¤á
DD = [A4] '¤é´Á
Mch = Application.Match(CLng(DD), [q³f©ú²Óªí!k:k], 0) '¥ýÀˬd¤é´Á¬O§_¦s¦b
If IsNumeric(Mch) Then
Arr = Range([q³f©ú²Óªí!m1], [q³f©ú²Óªí!a1].Cells(Rows.Count, 1).End(xlUp))
For i = Mch To UBound(Arr)
If Arr(i, 11) <> DD Then Exit For
If Arr(i, 11) = DD And Arr(i, 1) = NM Then '¤é´Á¬Û¦P+«È¤á¬Û¦P
MsgBox "¡°¤é´Á:" & DD & "¡A«È¤á:" & NM & "¤w¸g¦³¸ê®Æ! " & vbCrLf & _
"¡@Y·Q·s¼WÂÂq³æªº¤º®e¡A½Ð¨Ï¥Î¡eקï¿é¤J¡f«ö¶s¡I¡@"
Exit Sub
End If
Next i
End If
End If
'////////////////////////////////////////////////
'-----------------------------------------------
pNo = [a8].Text
If UCase(Right([M2], 1)) = "S" And pNo = "" Then
MsgBox "**¡i«È¤á½s¸¹¡G" & [M2] & "¡jµ²§À¦³""S"", ¥²¶·¿é¤J¡i±ÄÁʳ渹¡j, " & vbCrLf & vbCrLf & _
"Y¨S¦³¡i±ÄÁʳ渹¡j,©Î¼È®É¤£¿é¤J, ½Ð¿é¤J0!"
[a8].Select: Exit Sub
End If
If pNo = "N/A" Then pNo = ""
'-----------------------------------------------
Arr = Range("D4:J" & R)
ReDim Crr(1 To CN, 1 To 13)
For i = 1 To UBound(Arr)
If Val(Arr(i, 4)) <= 0 Then GoTo 101
N = N + 1
'(1)«È¤á(2)«È¤á½s¸¹(3)¶µ¥Ø½s¸¹(4)¶µ¥Ø¦WºÙ(5)¼Æ¶q(6)³æ»ù(7)ª÷ÃB(8)Ãþ§O(9)¨®½s(10)³æ¸¹(11)¤é´Á(12)¦Xpª÷ÃB(13)±ÄÁʳ渹
QQ = Array([a2], [M2], Arr(i, 1), Arr(i, 2), Arr(i, 4), Arr(i, 5), "=N(RC[-2])*N(RC[-1])", Arr(i, 7), [M4], xNum, [A4], Val([O7]), pNo)
For j = 0 To UBound(QQ)
Crr(N, j + 1) = QQ(j)
Next j
101: Next i
If N = 0 Then Exit Sub
'-------------------------------------
'¡×2021.07.10¼Wססססססססססס×
With Sheets("q³f©ú²Óªí")
With .[A65536].End(xlUp)(2).Resize(N, UBound(Crr, 2))
.Value = Crr
If [n5] = "ק襤" Then .Interior.ColorIndex = 35 'YÄÝקï..¶ñ²Hºñ¦â
End With
Range(.[m1], .[A65536].End(xlUp)).Sort Key1:=.[j1], Order1:=xlAscending, Header:=xlYes
End With
If [n5] = "ק襤" Then
[o2].Formula = "=IF(A4="""","""",IF(ISNA(MATCH(A4,q³f©ú²Óªí!K:K,)),TEXT(A4,""emmdd"")*1000,LOOKUP(TEXT(A4+1,""emmdd"")*1000,q³f©ú²Óªí!J:J))+1)"
[n5] = "«Ý©R¤¤"
End If
'=======================================
'-------------------------------------
ChangeChk = 1: [°e³f³æ!B2] = xNum
Call °e³f³æ_¸ü¤J: ChangeChk = 0
'----------------------------------------
Range("G4:G" & R).ClearContents: [a2] = "": [a8] = "" '²M°£:¼Æ¶q/«È¤á/±ÄÁʳ渹, ¨Ñ¤U¦¸¿é¤J
If MsgBox("¡°¿é¥X§¹¦¨, ¬O§_n¥ß§Y¸õ¦Ü[°e³f³æ]?? ", 4 + 32 + 256) = vbYes Then Application.Goto [°e³f³æ!A7]
End Sub
'********************************************* |
|