通过DV范围循环并发送到打印机

我有一些代码循环通过数据validation列表,并打印页面作为PDF文件,我无法弄清楚如何调整它只是发送页面到打印机,而不是打印为PDF。

Sub Button11_Click() Application.ScreenUpdating = False Dim cell As Range Dim rgDV As Range Dim DV_Cell As Range Dim ws As Worksheet Dim strPath As String Dim myFile As Variant Dim strFile As String Dim LA As Boolean Dim A As Integer Dim B As Integer Set DV_Cell = Range("B1") Set rgDV = Application.Range(Mid$(DV_Cell.Validation.Formula1, 2)) A = Application.InputBox("Enter Page From") B = Application.InputBox("Enter Page To") Set ws = ActiveSheet For Each cell In rgDV.Cells DV_Cell.Value = cell.Value strFile = Cells.Range("B1") & " Period " & Cells.Range("J1") strFile = Cells(5, 17).Value & "\" & strFile & ".PDF" ws.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=strFile, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False, _ From:=A, _ To:=B Next Application.ScreenUpdating = True Application.ScreenUpdating = True End Sub 

任何build议如何做到这一点,将不胜感激。

 Sub Button11_Click() Application.ScreenUpdating = False Dim cell As Range Dim rgDV As Range Dim DV_Cell As Range Dim ws As Worksheet Dim strPath As String Dim myFile As Variant Dim strFile As String Dim LA As Boolean Dim A As Integer Dim B As Integer Set DV_Cell = Range("B1") Set rgDV = Application.Range(Mid$(DV_Cell.Validation.Formula1, 2)) A = Application.InputBox("Enter Page From") B = Application.InputBox("Enter Page To") Set ws = ActiveSheet For Each cell In rgDV.Cells DV_Cell.Value = cell.Value ActiveSheet.PrintOut From:=A, To:=B Next Application.ScreenUpdating = True End Sub