- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 53# emma - Option Explicit
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim Target_Row As String, s As Integer, dot As Long, K As Integer, M As String, t As String
- Dim Ar(), A As Range, Rng As Range
- If Target.Address(0, 0) = "E1" Then
- Range("D3").AutoFilter Field:=4, Criteria1:="*" & Target & "*"
- ElseIf Target.Address(0, 0) = "C1" Then
- Range("C3").AutoFilter Field:=3, Criteria1:="*" & Target & "*"
- End If
- Application.EnableEvents = False '****
- Set Rng = Range("B4:B65536").SpecialCells(xlCellTypeVisible) '¦Û°Ê¿z¿ï«á¥i¨£ªºÀx¦s®æ
- If Application.Count(Rng) > 0 Then '¥i¨£ªºÀx¦s®æ:¦³¸ê®ÆÀx¦s®æªºÁ`¼Æ>0
- Set Rng = Rng.SpecialCells(xlCellTypeConstants) '¥i¨£ªºÀx¦s®æ:¦³¸ê®ÆªºÀx¦s®æ
- For Each A In Rng.Cells
- ReDim Preserve Ar(s)
- If A.Offset(, 8) = "V" And A.Offset(, 9) >= Date And A > A.Offset(, 4) Then dot = Int(A / 1000) * 1000 Else dot = 0
- K = IIf(Sheets("¬d¸ß").[b1] = "Á`©±", 10, 11)
- If A.Offset(, 7) < Date Then
- M = "¤wµ²§ô"
- t = "¤w¥X³f"
- ElseIf A < A.Offset(, 4) Then
- M = "¹B¶O+¤âÄò¶O"
- t = "¥¼¥X³f"
- ElseIf InStr(A.Offset(, 5), "±À") And A > A.Offset(, 4) Then '¥]§t
- M = "§K¹B"
- t = "¥¼¥X³f"
- ElseIf InStr(A.Offset(, 5), "±À") = 0 And A > A.Offset(, 4) Then '¤£¥]§t
- M = "¹B¶O"
- t = "¥¼¥X³f"
- End If
- Ar(s) = Array(A.Offset(, 2).Value, A.Value, A.Offset(, 3).Value, dot, A.Offset(, 12).Value, A.Offset(, K).Value, M, A.Offset(, 6).Value, A.Offset(, 7).Value, t)
- s = s + 1
- Next
- With UserForm2
- .TextBox1 = Ar(s - 1)(0)
- .TextBox2 = dot
- .TextBox3 = M
- .Show
- End With
- End If
- With Sheets("¬d¸ß")
- If s > 0 And UserForm2.Msg = False Then
- Target = ""
- .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(s, 10) = Application.Transpose(Application.Transpose(Ar))
- .Range("A4").CurrentRegion.Sort Key1:=.[A4], Header:=xlYes
- Sheets("¸ê®ÆÀÉ").[C2] = .Range("A" & .Rows.Count).End(xlUp).Offset(, 5) 'FÄæ:Àx¦ì
- End If
- End With
- Application.EnableEvents = True '*******
- End Sub
½Æ»s¥N½X- Public Msg As Boolean '«ö¤U [¨ú®ø] ªº¤½¥ÎÅܼÆ
- Private Sub CommandButton1_Click()
- UserForm2.Hide
- End Sub
- 'UserForm2 ¶·¼W¥[¤@CommandButton2 '¨ú®ø«ö¶s
- Private Sub CommandButton2_Click()
- Msg = True ''«ö¤U [¨ú®ø] «ö¶s¬° True
- UserForm2.Hide
- End Sub
- Private Sub UserForm_Activate() 'UserForm Åã¥Ü®É
- Msg = False '¨ú®ø [¨ú®ø]«ö¶s
- End Sub
½Æ»s¥N½X |
|