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 VBA Code printing problem

Hi there hope someone can help me deal to this.

What im trying to achieve is, Send the print job to the print previe
and finally sending the job to the printer if desired and NOT prin
blank rows beyond the actual data, keeping in mind all cells ar
populated with formula linked to sheet1. this dataset has 2 pages.
there are 15 datasets on the sheet.

this is the formula that I am using to print page one of two, I hav
another macro to print page 2 if I see it is occupied by data.

**********

this is the code that works as per last sentence.

Sub print1()
Application.ScreenUpdating = False
Sheets("Psheet").Select
Range("A1:U60").Select
ActiveWindow.SelectedSheets.PrintPreview
Selection.PrintOut Copies:=1, Collate:=True
Sheets("sheet1").Select
Range("D7").Select
Application.ScreenUpdating = True
End Sub

*************

this is the code that gives me the yes no criteria but drops the rang
selection and tries to print the entire sheet which is 30 printabl
pages. :-(

*************

Sub myprint1test()
If MsgBox("Do you want to Print this Document?", vbYesNo, "Repor
Preview and Print Check") = vbNo Then Exit Sub
Application.ScreenUpdating = False
Sheets("Print1test").Select
Range("A1:U60").Select
ActiveWindow.SelectedSheets.PrintPreview
Selection.PrintOut Copies:=1, Collate:=True
Sheets("sheet1").Select
Range("D7").Select
Application.ScreenUpdating = True
MsgBox "Your Report is now Printing"
End Sub

Hope someone can end my misery. I know it must be a simple solution t
fix it but I can't figure it out.

Im hoping to use this fix in a another spreadsheet which is about 50
rows long.

Thanks in advance

--
Message posted from http://www.ExcelForum.com

 
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
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
Printing code Jase Excel Discussion (Misc queries) 2 September 15th 08 07:49 PM
Printing code mn[_2_] Excel Programming 1 January 21st 04 12:35 AM
Use code to cancel printing Jim [email protected] Excel Programming 1 October 30th 03 10:05 PM
Improved printing of VBA code? Revolvr[_2_] Excel Programming 0 September 2nd 03 05:22 PM


All times are GMT +1. The time now is 04:19 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"