excel如何设置指定的打印机来打印? 50
电脑上连接有两个打印机,部分Excel文档必需用其中的一个针式打印机打印成票据才行,默认打印机改来改去太麻烦了,想直接在Excel中指定使用针式打印机,应该怎么改打印的宏...
电脑上连接有两个打印机,部分Excel文档必需用其中的一个针式打印机打印成票据才行,默认打印机改来改去太麻烦了,想直接在Excel中指定使用针式打印机,应该怎么改打印的宏代码?〓〓想使用的打印机名为DPK770-USB 端口USB002〓〓
源打印代码如下(中间的三处省略号是因字数限制省略部分不相关内容):
Sub Macro1()
' Macro1 Macro
' 快捷键: Ctrl+j
Range("G3:L3,A3:L3,B2,A1:L1,H2,J2,L2").Select
Range("L2").Activate
With Selection.Font
……
End With
……
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("A3:L9").Select
Range("G9").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1:L3").Select
Range("G3").Activate
With Selection.Font
……
End With
Range("N5").Select
End Sub 展开
源打印代码如下(中间的三处省略号是因字数限制省略部分不相关内容):
Sub Macro1()
' Macro1 Macro
' 快捷键: Ctrl+j
Range("G3:L3,A3:L3,B2,A1:L1,H2,J2,L2").Select
Range("L2").Activate
With Selection.Font
……
End With
……
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("A3:L9").Select
Range("G9").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1:L3").Select
Range("G3").Activate
With Selection.Font
……
End With
Range("N5").Select
End Sub 展开
展开全部
目前还没有,不要做这无用功,开始菜单打印时可以选择打印机。
不要直接点打印
不要直接点打印
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
设置宏按钮,录入宏,点击打印时自动选择非默认打印机,打印结束后恢复默认打印机,其他表格依旧是默认打印机。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询