Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
kcm kcm is offline
external usenet poster
 
Posts: 3
Default How to print last page of sheet?

Hi,

I would like to print only the last page of a sheet with the simple
click on a button, but I cannot find a way to program that.

Thanks for any help on the subject.

Kees

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to print last page of sheet?

Hi

Try this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"kcm" wrote in message ...
Hi,

I would like to print only the last page of a sheet with the simple click on a button, but I cannot find a way to program that.

Thanks for any help on the subject.

Kees



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default How to print last page of sheet?

Hi
use the following:
Sub print_last
Dim i As Integer
i = ExecuteExcel4Macro("Get.Document(50)")
ActiveWindow.SelectedSheets.PrintOut From:=i, To:=i, _
Copies:=1, Collate:=True
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

"kcm" schrieb im Newsbeitrag
...
Hi,

I would like to print only the last page of a sheet with the simple
click on a button, but I cannot find a way to program that.

Thanks for any help on the subject.

Kees


  #4   Report Post  
Posted to microsoft.public.excel.programming
kcm kcm is offline
external usenet poster
 
Posts: 3
Default How to print last page of sheet?

Frank,

Nice trick, works fine.

Thanks,
Kees

Frank Kabel wrote:

Hi
use the following:
Sub print_last
Dim i As Integer
i = ExecuteExcel4Macro("Get.Document(50)")
ActiveWindow.SelectedSheets.PrintOut From:=i, To:=i, _
Copies:=1, Collate:=True
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

"kcm" schrieb im Newsbeitrag
...

Hi,

I would like to print only the last page of a sheet with the simple
click on a button, but I cannot find a way to program that.

Thanks for any help on the subject.

Kees




  #5   Report Post  
Posted to microsoft.public.excel.programming
kcm kcm is offline
external usenet poster
 
Posts: 3
Default How to print last page of sheet?

Ron,

Thanks. Is this documented somewhere?

Kees


Ron de Bruin wrote:

Hi

Try this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
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
Print one page per sheet Very Basic User Excel Discussion (Misc queries) 3 March 9th 10 12:42 PM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
How can I print a different header on each page of an Excel Sheet Fatrad Excel Discussion (Misc queries) 2 June 30th 05 07:20 PM
How can I print page 2 of each sheet in a workbook? sflower Excel Discussion (Misc queries) 1 March 9th 05 02:15 PM
Print excel sheet in one page ketan Excel Programming 4 October 7th 03 02:44 PM


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