Print button that prints the listed parameters

DeanML

New Member
Joined
May 15, 2019
Messages
2
I am fairly efficient with the internal commands of excel, but VBA's are very new to me. It took me 4 hours to program a saveas button, but with a lot of internet searching I was able to determine where my issues were. Now I have been trying another button on the same page for a "Print" function. Its a dynamic form that will not be modified other than filled in data. So I want to program a form control button to print the following:
Range
Portrait
Fit to page
Current Printer

I haver been all over the board with this and maybe because the places I look the help I for older versions of excel.

Any help would be appreciated.
JV
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Record a macro where you set the printing parameters and click print.

If you need help editing the recorded macro, post the macro here and ask for help.
 
Last edited:
Upvote 0
Sub Button_Click_2()
ActiveSheet.PrintOut
Range("A1:J61").Select
ActiveSheet.PageSetup.printArea = "A1:J61"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
End Sub

I can print, but it is double printing. Almost like the button gets pressed twice...

Joe
 
Upvote 0
Code:
[COLOR=#333333]Sub Button_Click_2()[/COLOR]
[COLOR=#333333]ActiveSheet.PageSetup.printArea = "A1:J61"[/COLOR]
[COLOR=#333333]ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate[/COLOR][COLOR=#333333]:=True[/COLOR]
[COLOR=#333333]End Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top