Sub Click()
Dim x, r, i
Set x = Selection
r = x.Rows.Count
If r < 4 Then End
x.Clear
x.Borders.LineStyle = 1
[z1].Copy Application.Index(x, 1, 0) '首行
For i = 2 To r Step 2 '中间
[z2].Copy Application.Index(x, i, 0)
Next i
[z3].Copy Application.Index(x, r, 0) '末行
End Sub
Set sel = Selection.SpecialCells(xlCellTypeVisible)
Set fmt = Sheets(2).Range("a1") '辅助区
ac = sel.Areas.Count '所选区域的子区个数
Application.ScreenUpdating = False
fmt.Offset(1, 0).Resize(2).Copy: sel.PasteSpecial xlPasteFormats '中间
fmt.Copy: Application.Index(sel.Areas(1), 1, 0).PasteSpecial xlPasteFormats '首行
fmt.Offset(3, 0).Copy: Application.Index(sel.Areas(ac), sel.Areas(ac).Rows.Count, 0).PasteSpecial xlPasteFormats '末行
End Sub