|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 填写标签()
- Dim arr, i%, m, n
- arr = Sheet1.[a1].CurrentRegion
- 清空
- For i = 4 To UBound(arr)
- m = m + 1
- n = n + 1
- Cells((Int((n + 2) / 3) - 1) * 6 + 2, (m - 1) * 5 + 2) = "'" & arr(i, 2)
- Cells((Int((n + 2) / 3) - 1) * 6 + 3, (m - 1) * 5 + 2) = arr(i, 3)
- Cells((Int((n + 2) / 3) - 1) * 6 + 4, (m - 1) * 5 + 2) = arr(i, 17)
- Cells((Int((n + 2) / 3) - 1) * 6 + 5, (m - 1) * 5 + 2) = arr(i, 5)
- Cells((Int((n + 2) / 3) - 1) * 6 + 5, (m - 1) * 5 + 4) = arr(i, 18)
- If m = 3 Then m = 0
- If n = 21 Then
- Range("A1:N41").PrintOut
- n = 0: 清空
- End If
- Next
- Range("A1:N41").PrintOut
- End Sub
- Sub 清空()
- For i = 1 To 3
- For j = 1 To 7
- Range(Cells((j - 1) * 6 + 2, (i - 1) * 5 + 2), Cells((j - 1) * 6 + 4, (i - 1) * 5 + 4)) = ""
- Cells((j - 1) * 6 + 5, (i - 1) * 5 + 2) = ""
- Cells((j - 1) * 6 + 5, (i - 1) * 5 + 4) = ""
- Next
- Next
- End Sub
复制代码 |
|