Print from preview

  • Thread starter Thread starter shakey
  • Start date Start date
S

shakey

I have a Macro that sorts data then gives me a print preview to confirm I
agree with results, IE manually resolve ties, not common. In order to print
from that view I need to exit preview - click on excel button - select
print - select print type - agree to printer,nr, etc - finally print.
I can not get a printer icon on the print preview window active.
Bottom line - What is the shortest way to print from print preview?
Thank you
Mel
 
Doe this work for you?

Sub Macro1()
ActiveWindow.SelectedSheets.PrintPreview
myreply = InputBox("Print? Y/N")
If UCase(myreply) = "Y" Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
End Sub
 
I spliced your idea in at the end of my existing one and it cuts out many
steps so it is very helpful. I still need to close preview before I can see
the input box, no big deal.
My macro:
col = InputBox("enter column letter:")
Rows("4:40").Select
Selection.Sort Key1:=Cells(4, col), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$40"
ActiveWindow.SelectedSheets.PrintPreview MY OLD END
myreply = InputBox("Print? Y/N")
If UCase(myreply) = "Y" Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If

End Sub

Thank you
Mel
 
Back
Top