ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can I put button on spreadsheet to make it print a specific part? (https://www.excelbanter.com/excel-worksheet-functions/246599-can-i-put-button-spreadsheet-make-print-specific-part.html)

CindyMc

Can I put button on spreadsheet to make it print a specific part?
 
I have created a spreadsheet with several pages on it. I would like to be
able to have a button at each page that can be pushed to print that
particular page. I am fairly familiar with excel but not with macros. Can I
do this with a macro?

ryguy7272

Can I put button on spreadsheet to make it print a specific part?
 
Ok, this is pretty simple. Turn on the macro recorder:
http://www.anthony-vba.kefra.com/vba/vbabasic1.htm

Another example of how to get started with VBA:
http://www.vbtutor.net/VBA/vba_chp1.htm


Follow the short example here to set the print area:
http://spreadsheets.about.com/od/exc...printing_6.htm

Turn off the macro recorder.

Try that and post back and let me know how you're gettin' along.

HTH,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"CindyMc" wrote:

I have created a spreadsheet with several pages on it. I would like to be
able to have a button at each page that can be pushed to print that
particular page. I am fairly familiar with excel but not with macros. Can I
do this with a macro?


JCS

Can I put button on spreadsheet to make it print a specific part?
 
Hi Cindy,

Yes you can do what your are asking.
Open up the Macro Editor (Alt-F11)
Select Insert and then Module

Paste in the following code:
Sub Page1()
'
Range("A23").Select
Selection.CurrentRegion.Select
Selection.PrintOut Copies:=1
Range("A23").Select
End Sub

Sub Page2()
'
Range("A45").Select
Selection.CurrentRegion.Select
Selection.PrintOut Copies:=1
Range("A45").Select
End Sub

and so forth... Change the cell names in the Range command to the upper
left corner of your range for each page. Then create a macro button located
on the Forms toolbar (Excel 2003) and assign each macro to the appropriate
button.

If this helps, please press YES.

JCS

"CindyMc" wrote:

I have created a spreadsheet with several pages on it. I would like to be
able to have a button at each page that can be pushed to print that
particular page. I am fairly familiar with excel but not with macros. Can I
do this with a macro?



All times are GMT +1. The time now is 08:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com