How to print last page of sheet?

  • Thread starter Thread starter kcm
  • Start date Start date
K

kcm

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
 
Hi

Try this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End Sub
 
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
 
Frank,

Nice trick, works fine.

Thanks,
Kees

Frank said:
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
 
Hi Kees

It is a old xl4macro

Tom Ogilvy posted the following links

**************************
http://support.microsoft.com/default.aspx?scid=kb;en-us;143466
XL97: Macro97.exe File Available on Online Services

http://support.microsoft.com/default.aspx?scid=kb;en-us;128185
XL: Macrofun.exe File Available on Online Services

These are in the old Help format. You can get ones in html help format for
xl2000 and xl2002 from the office download site:

http://office.microsoft.com/Downloads/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top