- ©«¤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
|
¦^´_ 9# jackson7015
¸Õ¸Õ¬Ý- '³£¬OModule3¤Wªºµ{¦¡½X
- Sub ¬d¸ß¸ê®Æ()
- ' Worksheet_Change [A5] '¥i¥H³o¼Ë°µ
- Ex
- End Sub
- 'Sheets("¬d¸ß¥Îªí³æ")ªºWorksheet_Change¨Æ¥ó,§A¬O·Q·h²¾¨ìModule3¼Ò²Õ¤W
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim A As Range, Rng As Range
- If Target.Column = 1 Then
- With Sheets("ºî¦X¸ê®Æ®w")
- For i = 1 To .UsedRange.Rows.Count
- Set A = .UsedRange.Rows(i).Find(Target)
- If Not A Is Nothing Then
- If Rng Is Nothing Then
- Set Rng = .UsedRange.Rows(i)
- Else
- Set Rng = Union(Rng, .UsedRange.Rows(i))
- End If
- End If
- Next
- End With
- End If
- Application.EnableEvents = False
- If Not Rng Is Nothing Then
- Rng.Copy: Target.Offset(, 1).PasteSpecial 3
- Else
- Target.Offset(, 1).Resize(, 50) = ""
- End If
- Application.EnableEvents = True
- MsgBox "¬d¸ßµ²§ô"
- End Sub
- Private Sub Ex()
- Dim F As Range, AD As String, Rng As Range, xRng As Range
- Set xRng = Sheets("¬d¸ß¥Îªí³æ").[A5]
- With Sheets("ºî¦X¸ê®Æ®w").UsedRange
- Set F = .Find(xRng, LOOKAT:=xlPart)
- If Not F Is Nothing Then AD = F.Address
- Do While Not F Is Nothing
- If Rng Is Nothing Then
- Set Rng = .Rows(F.Row)
- Else
- Set Rng = Union(Rng, .Rows(F.Row))
- End If
- Set F = .FindNext(F)
- If F.Address = AD Then Exit Do
- Loop
- End With
- If Not Rng Is Nothing Then
- Rng.Copy xRng.Offset(, 1)
- MsgBox "¬d¸ßµ²§ô"
- Else
- xRng.Offset(, 1).Resize(, 50) = ""
- End If
- End Sub
½Æ»s¥N½X |
|