- ©«¤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-11-28
|
¦^´_ 5# av8d
®¥³ß«e½ú
«á¾Ç¦³¸Õ¦¨¥\:
«á¾Ç¦³Ó·Qªk:
¨¾¤îIJµo¦AIJµo,¤£ª¾¹D¥¿¤£¥¿½T??
½Ð«e½úÌ«ü¾É!ÁÂÁÂ
1.«e¤è¥[ Application.EnableEvents = False:IJµo¥¢®Ä
2.«á¤è¥[Application.EnableEvents = True:IJµo±Ò°Ê
3.Application.EnableEvents = True: Exit Sub:Â÷¶}«eIJµo±Ò°Ê
ìµ{¦¡½X²K¥[¦p¤U:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Left(Target.Address(0, 0), 1) = "A" Then
ElseIf Left(Target.Address(0, 0), 1) = "B" Then
If Cells(Target.Row, 2) = "¶K¤W¤å¸¹" Then
[B1] = ""
For i = 0 To 5000
If Cells(3 + i, 2) = "" Then
Cells(3 + i, 2).Select
ActiveSheet.PasteSpecial xlPasteValues
[B1] = "§¹¦¨"
'§PÂ_¬O§_«½Æ½Æ»s
If Cells(3 + i, 2) = Cells(2 + i, 2) Then
[B1] = "«½Æ½Æ»s"
Cells(3 + i, 2) = ""
End If
Application.EnableEvents = True: Exit Sub
End If
Next
End If
ElseIf Left(Target.Address(0, 0), 1) = "C" Then
If Cells(Target.Row, 3) = "¶K¤W¦W¦r" Then Application.EnableEvents = True: Exit Sub
ElseIf Left(Target.Address(0, 0), 1) = "D" Then
If Cells(Target.Row, 4) = "·j´M¤å¸¹ ¡ô¡ô¡ô" Then [D1].Select
ElseIf Left(Target.Address(0, 0), 1) = "E" Then
If Cells(Target.Row, 5) = "½Æ»s¤å¸¹" Then [D1].Select
ElseIf Left(Target.Address(0, 0), 1) = "F" Then
If Cells(Target.Row, 6) = "½Æ»s¦W¦r" Then [D1].Select
ElseIf Left(Target.Address(0, 0), 1) = "G" Then
If Cells(Target.Row, 7) = "·j´M¦W¦r ¡ô¡ô¡ô" Then [G1].Select
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address(0, 0) = "D1" Then
If [D1] = "" Then ActiveSheet.Range("E2").AutoFilter Field:=1: Application.EnableEvents = True: Exit Sub
[G1] = ""
'·j´M¤å¸¹
Range("E2").AutoFilter Field:=1, Criteria1:="*" & Target & "*"
ActiveWindow.ScrollRow = 1
ElseIf Target.Address(0, 0) = "G1" Then
If [G1] = "" Then ActiveSheet.Range("F2").AutoFilter Field:=2: Application.EnableEvents = True: Exit Sub
[D1] = ""
'·j´M¦W¦r
Range("G2").AutoFilter Field:=2, Criteria1:="*" & Target & "*"
ActiveWindow.ScrollRow = 1
End If
Application.EnableEvents = True
End Sub |
|