Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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!

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 SubTo create a button, you can either:
- Create a shape in the workbook
- Right Click it
- Choose Assign macro
- Pick the MyPrintor
- 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

![]() |
![]() |
![]() |

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