Computing.Net > Forums > Office Software > EXCEL - create print button

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

EXCEL - create print button

Reply to Message Icon

Name: fight
Date: November 16, 2008 at 17:38:33 Pacific
OS: xp
CPU/Ram: /2 B
Product: HP
Comment:

Could anyone tell me how to create a separate button within the worksheet to print a selected area rather from selecting from the print area in the menu bar. eg print only from A1 to G5 when the manual button is clicked.
Many Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: November 16, 2008 at 19:48:38 Pacific
Reply:

This code will save the current PrintArea, set the PrintArea to A1:G5, Print the sheet and then restore the original PrintArea.

Sub MyPrint()
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "A1:G5"
ActiveSheet.PageSetup.PrintArea = myPrtArea
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = curPrtArea
End Sub

To create a button, you can either:
- Create a shape in the workbook
- Right Click it
- Choose Assign macro
- Pick the MyPrint

or

- Use Tools...Customize
- Click the Commands tab
- Scroll down to Macros
- Grab the Custom Button and drag it to a tool bar.
- Right click the button
- Assign the Macro, Edit the picture, Edit the name, etc.
- Close the Customize box


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: EXCEL - create print button

Print button in excel www.computing.net/answers/office/print-button-in-excel/8213.html

Print button in Excel www.computing.net/answers/office/print-button-in-excel/9138.html

printing multiple worksheets in excel in colo www.computing.net/answers/office/printing-multiple-worksheets-in-excel-in-colo/9395.html