tnjk.net
当前位置:首页 >> vBA批量打印 >>

vBA批量打印

没测试, 直接 写 你要 最多多少个, 依次 打印 1 到 n Sub 打印() m = InputBox("请输入最大打印份数") For i = 1 To m Range("H" & i) = i Calculate ActiveSheet.PrintOut Next End Sub

打印?你这是填写的效果吧?

Sub 自动筛选打印() Dim d As Object Set d = CreateObject("scripting.Dictionary") Dim c As Range, key i = 2 Do i = i + 1 Set c = Cells(i, 6) d(c.Value) = "" Loop Until c = "" key = d.Keys For x = 0 To d.Count ActiveSheet.UsedRang...

批量打印可以通过VBA的,代码如下: Sub 批量打印() '遍历工作表,实现批量打印 For i = 1 To Sheets.Count Sheets(i).PrintOut Next End Sub

如何用 Excel VBA 批量打印文件 有时候一个文件夹内有很多 Excel 文件,几十个,上百个,如果一个个的打开, 然后再打印,显然重复劳动,效率低下。Sub Copy_Data()Dim wb As Workbook, rng As Range, sht As WorksheetDim sht_Name, theDatesht_Name ...

代码: sub 宏1() dim p,n,st as worksheet p="c:\" '文件所在位置,你可能需要修改,没必须是\ n=dir(p & "&.xls*") do while n"" with workbooks.open(p & n) for each st in .sheets if st.name="施工记录" or st.name="施工记录 (2)" or st....

这个其实很简单 楼主自行录制一段打印的宏就可以了 根据录入的宏,再做微调就可以了 如果楼主还有疑问,可以进一步明确描述下或者截图说明下的

如何用 Excel VBA 批量打印文件 有时候一个文件夹内有很多 Excel 文件,几十个,上百个,如果一个个的打开, 然后再打印,显然重复劳动,效率低下。Sub Copy_Data()Dim wb As Workbook, rng As Range, sht As WorksheetDim sht_Name, theDatesht_Name ...

直接将1改成字符型变量即可,如变量为X,这句改为 .ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Pages:="" & X X前面连接引号的好处在于不管X变量是数字还是数字型文本都不会出错

Public Sub printArea() Application.PrintCommunication = False With ActiveSheet.PageSetup .printArea = "$A$1:$N$21" .FitToPagesWide = 1 .FitToPagesTall = 0 End With Application.PrintCommunication = TrueEnd Sub

网站首页 | 网站地图
All rights reserved Powered by www.tnjk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com