Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Casper
 
Posts: n/a
Default How do I put a button on an excel spreadsheet to print a report?

Hi please help
I want to put a button onto a excel spreadsheet (not the toolbar) that will
print a report for me from another sheet, what macro do I use and what
options do I use
Regards
Casper
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I would record a macro when I printed what I wanted.

Then I'd use a button from the Forms toolbar and plop it onto that other
sheet--and assign that recorded macro to that button.

Your recorded macro may look something like:

Option Explicit
Sub Macro1()
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

I'd change it to be more specific (and give it a nice name):

Option Explicit
Sub PrintSheet1()
worksheets("sheet1").PrintOut Copies:=1, Collate:=True
End Sub

Casper wrote:

Hi please help
I want to put a button onto a excel spreadsheet (not the toolbar) that will
print a report for me from another sheet, what macro do I use and what
options do I use
Regards
Casper


--

Dave Peterson
  #3   Report Post  
keithl816
 
Posts: n/a
Default


Hi Casper,

Try going to design mode in your toolbar and clicking on the command
button icon place it on the sheet desired then right click the button,
click view code and try placing the code below.

I set this up as sheet 2 being the one printed, change as needed. The
same will go for the print range.


Code:
--------------------

Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("sheet2").Visible = True
Sheets("sheet2").Select

ActiveSheet.PageSetup.PrintArea = "$A$1:$I$508"
ActiveWindow.SelectedSheets.PrintOut copies:=1, collate:=True
Sheets("sheet2").Visible = True
Application.ScreenUpdating = True

End Sub

--------------------


Hope this helps


--
keithl816
------------------------------------------------------------------------
keithl816's Profile: http://www.excelforum.com/member.php...o&userid=21287
View this thread: http://www.excelforum.com/showthread...hreadid=390798

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
create excel spreadsheet to display data from filled text forms pluck4me Excel Discussion (Misc queries) 0 April 20th 05 08:37 PM
Auto Formatting an Excel Spreadsheet Ray Excel Discussion (Misc queries) 0 January 19th 05 09:57 PM
How to rename the Excel button on the desktop? Les Excel Discussion (Misc queries) 1 December 29th 04 11:05 PM
How do I export an Excel spreadsheet to Pocket PC (Pocket Excel)?. Selena Excel Discussion (Misc queries) 1 December 7th 04 03:01 AM
How do I password protect cells in a spreadsheet created in Excel [email protected] Excel Worksheet Functions 0 November 22nd 04 09:21 PM


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"