excel批量打印固定资产标签

2025-10-14 06:15:11

1、建立固定资产明细表

excel批量打印固定资产标签

2、设置标准模板,此处选择一张A4纸打印8个标签,调试好页边距

excel批量打印固定资产标签

3、插入VB代码

excel批量打印固定资产标签

4、插入模块代码

Sub pldy()

Dim a As Integer

Dim b As Integer

Dim K As Integer

a = InputBox("请输入开始打印序号")

b = InputBox("请输入结束打印序号")

For i = a To b

L = (((i - ((i + 1) Mod 2)) Mod 8) \ 2) * 7 + 2

If i Mod 2 = 0 Then

K = 5

Else

K = 2

End If

Sheets("标签打印").Cells(L, K) = Sheets("资产明细").Range("d" & i + 1)

Sheets("标签打印").Cells(L + 1, K) = Sheets("资产明细").Range("b" & i + 1)

Sheets("标签打印").Cells(L + 2, K) = Sheets("资产明细").Range("i" & i + 1)

Sheets("标签打印").Cells(L + 3, K) = Sheets("资产明细").Range("k" & i + 1)

Sheets("标签打印").Cells(L + 4, K) = Sheets("资产明细").Range("g" & i + 1)

If Int(i / 8) = (i / 8) Then

ActiveSheet.PrintOut

End If

Next i

End Sub

此处引用明细表的D,B,I,K,G五列,可根据需要修改代码

excel批量打印固定资产标签

5、插入 命令按钮

excel批量打印固定资产标签

excel批量打印固定资产标签

6、点击命令按钮,输入开始结束序号自动打印

excel批量打印固定资产标签

excel批量打印固定资产标签

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢