print file using macro

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Print file using macro

Print file using macro

resolvedResolved · Medium Priority · Version 2007

Natasha has attended:
Excel VBA Intro Intermediate course

Print file using macro

how do I get a macro to print a file

RE: print file using macro

Hi Natasha

Thank you for your question

To print a worksheet you should use the printout method of the sheet object

For example

 ActiveSheet.PrintOut 


The printout method has a number of optional arguments that can be used to specify default printers, number of pages, number of copies etc.

If you type the above line of code into the VBE, select PrintOut and press F1, you will see the detailed help for the method

Regards

Stephen

Mon 28 Sep 2009: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Naming and Using Constants

Constants make calculations easier so worksheets are more easily understood. Constant values also need to be given relevant and memorably names. It is also easier to change the value of a constant.

For example:
Instead of entering 17.5% in each cell when you generate a VAT amount you could name a Constant "VAT" and assigning a "0.175" value to it. To do this:

From the 'Insert' menu select 'Name', then select 'Define'.

Enter the constant

View all Excel hints and tips


Server loaded in 0.07 secs.