LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Print Macro


The following code is under my Print Macro button and works OK excep
that
I have increased the size of the form that it prints out and now spill
onto a second page by about 5 lines.
What can I include into the below code to fit the printout onto
page??
Want it to work like the 'File' - 'Page Setup' - 'Fit To' option.

Sub Button4_Click()
'Print Forms
YesNo = MsgBox("Your selected Form will now be printed.", vbYesNo
vbCritical, " Print Form")
Select Case YesNo
Case vbYes
If vbYes Then GoTo 20 Else GoTo 10
10 Case vbNo
If vbNo Then GoTo 30
End Select
20 Application.ScreenUpdating = False
If ActiveSheet.Name = "Moves Request Form" Then
Else
End If
Sheet1.PageSetup.PrintArea = "B1:CW43" 'Sets the Print area
ActiveSheet.PrintOut 'Prints the Print area
Sheet1.PageSetup.PrintArea = "" 'Clears the Print area
If ActiveSheet.Name = "Moves Request Form" Then
Else
End If
Application.ScreenUpdating = True
30 End Su

--
grahamma
-----------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...fo&userid=2033
View this thread: http://www.excelforum.com/showthread.php?threadid=53886

 
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
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Why does macro speed slow after Excel Print or Print Preview? Larry A[_3_] Excel Programming 6 May 16th 05 11:22 AM
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook will Excel Programming 3 September 23rd 04 08:05 PM


All times are GMT +1. The time now is 04:54 AM.

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

About Us

"It's about Microsoft Excel"