Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Printing


Hello Programmers! :)

Below is a simple code (that I've recorded) to print the selected range
from 3 different worksheets. I know that all printers are different, but
the standard functions should be the same.

First of all, is there a way to simplify this code. Secondly, how do
you write in a code to, #1. Print the selected sheets in reverse order,
#2. and to rotate the sheets 180 degrees. I tried to record these
actions but they don't show up in the code. Are there some codes out
there for this, or is this a feature set up within the printers
software?

Sub PrintWorksheets()
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Sheets("Sheet2").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Sheets("Sheet3").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Sheets("Sheet1").Select
Range("A1").Select
End Sub

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=488462

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Printing


First, under the File Menu, choose Page Setup, Page and select Landscap
view.
Second, in your code, move Sheet 3 into the first position, leave Shee
2 where it is, and move Sheet1 into the third position.

Sub PrintWorksheets()
Sheets("Sheet3").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True

Sheets("Sheet2").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True

Sheets("Sheet1").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True

'leaving this code here makes sure the first page is selected whe
printing finishes
'you don't really need it.
Sheets("Sheet1").Select
Range("A1").Select

End Su

--
DataCollecto
-----------------------------------------------------------------------
DataCollector's Profile: http://www.hightechtalks.com/m36
View this thread: http://www.hightechtalks.com/t229535

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default VBA Printing

One way. You could also do a for i=1 to three and do for each sh

See if this works then change printpreview to printout
Sub loopthrusheetarray()
Dim Sh As Worksheet
For Each Sh In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
sh.range("a1:i52").printpreview
Next
End Sub


--
Don Guillett
SalesAid Software

"EMoe" wrote in message
...

Hello Programmers! :)

Below is a simple code (that I've recorded) to print the selected range
from 3 different worksheets. I know that all printers are different, but
the standard functions should be the same.

First of all, is there a way to simplify this code. Secondly, how do
you write in a code to, #1. Print the selected sheets in reverse order,
#2. and to rotate the sheets 180 degrees. I tried to record these
actions but they don't show up in the code. Are there some codes out
there for this, or is this a feature set up within the printers
software?

Sub PrintWorksheets()
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Sheets("Sheet2").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Sheets("Sheet3").Select
Range("A1:I52").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Sheets("Sheet1").Select
Range("A1").Select
End Sub

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:
http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=488462



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Printing


Thanks a bunch!

EMo

--
EMo
-----------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...fo&userid=2318
View this thread: http://www.excelforum.com/showthread.php?threadid=48846

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default VBA Printing

did you try my efficient code?

--
Don Guillett
SalesAid Software

"EMoe" wrote in message
...

Thanks a bunch!

EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:
http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=488462





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Printing


Hi Don!

Sorry it took me a while to get back to you. I just tried your
*efficient code*, and it works well. Now I see how to shorten my print
code, and I'll use this method in future programs.

Thanks,
EMoe :)


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=488462

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
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
Excel Printing --Borders are not printing on the same page as data Stup88 Excel Discussion (Misc queries) 1 August 7th 07 09:34 AM
Printing a heading on each new page when printing Brian Excel Discussion (Misc queries) 3 November 15th 06 05:22 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM
Printing? Worksheets not printing the same on multiple pc's! 43fan Excel Programming 2 April 29th 04 02:34 PM


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