|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
- If Target.Address = "$Q$1" Then Call QDB
- End Sub
- Sub QDB()
- Dim i%, j%, k%
- k = 3
- With Sheet2
- j = .[c65536].End(3).Row
- For i = 1 To j
- If Int((i - 1) / 30) Mod 2 Then
- i = i + 29
- Else
- Cells(k, 1) = i
- Cells(k, 2) = .Cells(i + 3, 2)
- Cells(k, 3) = .Cells(i + 3, 3)
- Cells(k, 6) = i + 30
- Cells(k, 7) = .Cells(i + 33, 2)
- Cells(k, 8) = .Cells(i + 33, 3)
- k = k + 1
- End If
- Next
- End With
- With Range("a3").CurrentRegion
- .RowHeight = 20 '设置行高
- .Borders.LineStyle = xlContinuous '边框
- .Offset(0, 5).Borders.LineStyle = xlContinuous
- End With
- End Sub
复制代码 |
|