Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1928|回复: 2

第一列打完之后自动第二列开始打起

[复制链接]
发表于 2017-4-2 15:20 | 显示全部楼层 |阅读模式
小标签.rar (16.55 KB, 下载次数: 14)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2017-4-2 22:22 | 显示全部楼层
回复

使用道具 举报

发表于 2017-4-6 23:32 | 显示全部楼层
本帖最后由 乐乐2006201506 于 2017-4-6 23:36 编辑

加入绿色部分代码试试(通过设置打印区域和插入分页符实现),打印时一页一张小标签。不知是否符合你的要求。  另外你的有些代码好像有问题。
Private Sub CommandButton1_Click()
For i = 6 To 26 Step 5
    Rows(i).Select
    ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Next i
For j = 4 To 13 Step 3
    Columns(j).Select
    ActiveWindow.SelectedSheets.VPageBreaks.Add Before:=ActiveCell
Next j
    Application.PrintCommunication = True
    ActiveSheet.PageSetup.PrintArea = "$A$1:$O$29"
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .HeaderMargin = Application.InchesToPoints(0.15748031496063)
        .FooterMargin = Application.InchesToPoints(0.511811023622047)
        .PrintComments = xlPrintNoComments
        .CenterHorizontally = True
        .CenterVertically = True
        .Orientation = xlPortrait
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .Zoom = 100
        .PrintErrors = xlPrintErrorsDisplayed
        .ScaleWithDocHeaderFooter = True
    End With
    Application.PrintCommunication = True


Application.ActivePrinter = "实达BP-690KPro 在 LPT1:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
        "实达BP-690KPro 在 LPT3:", Collate:=True

End Sub


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-27 16:38 , Processed in 0.407058 second(s), 14 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表