|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strTar$, tarRng As Range, ar(), n&
If Target.Address <> "$A$1" Then Exit Sub
strTar = [A1].Value
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = 20 To n Step 6
If Cells(i, 1).Value = strTar Then
Application.EnableEvents = False
Cells(i, 1).CurrentRegion.Copy
[A1].PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
Application.CutCopyMode = False
End If
Next i
End Sub
|
|