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

Excel XP, WinXP
I have the following macro to print the active sheet in reverse order if
more than one page is involved. My question concerns how to specify a range
to print. The line that starts with:
"NumPages = "
I believe addresses the active sheet (the used range) and will result in the
number of pages it will take to print the used range. How do I modify this
code if I want to print the range RngToPrint? Specifically, how would I
write the "NumPages =" line such that the value of NumPages would be the
number of pages it takes to print the range RngToPrint? Thanks you for your
help. Otto

Sub ReversePrint()
Dim NumPages As Long
Dim Page As Long
NumPages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
For Page = NumPages To 1 Step -1
ActiveSheet.PrintOut from:=Page, To:=Page
Next Page
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Printing in reverse order


Otto, set the print_area first.

Sub foo()
Dim rngtoprint As Range
Set rngtoprint = [a:h]
rngtoprint.Worksheet.Names.Add "print_area", rngtoprint
MsgBox Application.ExecuteExcel4Macro("get.document(50)")
End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Otto Moehrbach wrote :

Excel XP, WinXP
I have the following macro to print the active sheet in reverse order
if more than one page is involved. My question concerns how to
specify a range to print. The line that starts with: "NumPages = "
I believe addresses the active sheet (the used range) and will result
in the number of pages it will take to print the used range. How do
I modify this code if I want to print the range RngToPrint?
Specifically, how would I write the "NumPages =" line such that the
value of NumPages would be the number of pages it takes to print the
range RngToPrint? Thanks you for your help. Otto

Sub ReversePrint()
Dim NumPages As Long
Dim Page As Long
NumPages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
For Page = NumPages To 1 Step -1
ActiveSheet.PrintOut from:=Page, To:=Page
Next Page
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Printing in reverse order

Thanks for that tip. Otto
"keepITcool" wrote in message
ft.com...

Otto, set the print_area first.

Sub foo()
Dim rngtoprint As Range
Set rngtoprint = [a:h]
rngtoprint.Worksheet.Names.Add "print_area", rngtoprint
MsgBox Application.ExecuteExcel4Macro("get.document(50)")
End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Otto Moehrbach wrote :

Excel XP, WinXP
I have the following macro to print the active sheet in reverse order
if more than one page is involved. My question concerns how to
specify a range to print. The line that starts with: "NumPages = "
I believe addresses the active sheet (the used range) and will result
in the number of pages it will take to print the used range. How do
I modify this code if I want to print the range RngToPrint?
Specifically, how would I write the "NumPages =" line such that the
value of NumPages would be the number of pages it takes to print the
range RngToPrint? Thanks you for your help. Otto

Sub ReversePrint()
Dim NumPages As Long
Dim Page As Long
NumPages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
For Page = NumPages To 1 Step -1
ActiveSheet.PrintOut from:=Page, To:=Page
Next Page
End Sub



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
Reverse Row Order? trvlnmny New Users to Excel 3 May 30th 10 08:22 AM
Reverse Order PL Excel Discussion (Misc queries) 3 July 1st 09 05:01 AM
Reverse Order PL Excel Discussion (Misc queries) 1 June 17th 09 02:47 AM
Reverse the order? davegb Excel Programming 2 July 7th 05 09:18 PM
Printing in reverse order Bryan Excel Discussion (Misc queries) 3 June 22nd 05 05:30 PM


All times are GMT +1. The time now is 12:51 PM.

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"