|
楼主 |
发表于 2023-2-5 21:52
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 打印_Click()
- Range("B2").Select
- d = Range("B2").Value
- s = InputBox("请输入号:")
- Windows(d & "装潢表.xls").Activate
- Sheets("" & s & "").Select
- Application.EnableEvents = False
- ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2, Copies:=1, Preview:=False, ActivePrinter:="HP LaserJet M1005 Class Driver", PrintToFile:=False, Collate:=False, IgnorePrintAreas:=False
- Application.EnableEvents = True
- Windows(d & "勘查表.xls").Activate
- Application.EnableEvents = False
- ActiveWindow.SelectedSheets.PrintOut From:=1, To:=8, Copies:=1, Preview:=False, ActivePrinter:="HP LaserJet M1005 Class Driver", PrintToFile:=False, Collate:=False, IgnorePrintAreas:=False
- Application.EnableEvents = True
- Windows("正式报告.xls").Activate
- End Sub
复制代码- Sub 批量复制表格并重命名()
- Dim arr(), i, n, r
- n = Worksheets("列表").UsedRange.Count - 1
- ReDim arr(1 To n)
- For i = 1 To n
- arr(i) = Worksheets("列表").Cells(i + 1, 1)
- Next
- For r = 1 To UBound(arr)
- Worksheets("模板").Copy after:=Worksheets(1 + r)
- ActiveSheet.Name = arr(r)
- Next
- End Sub
复制代码 这两个如何拼凑能实现功能
|
|