Print from preview

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
 
B

Bernard Liengme

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
 
S

shakey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top