Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
nsgargya
 
Posts: n/a
Default Printing subset of pages dynamically using excel macros


Hi All:

I am trying to use Excel VBA macro to dynamically print certain number
of pages.

Let me explain:

I have a print button in the second page of my spreadsheet. When I
click this button I have to start ptinting from second page onwards .
But the end is dynamic. Depending on the number of records available it
can vary (i.e can be 10 records or 40 or 30 or2 etc).

I would really appreciate if some one could help me with this scenario.


I very badly need this in my project.

Thanks in advance

nsgargya


--
nsgargya
------------------------------------------------------------------------
nsgargya's Profile: http://www.excelforum.com/member.php...o&userid=27632
View this thread: http://www.excelforum.com/showthread...hreadid=471511

  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi

Try

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



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


"nsgargya" wrote in message
...

Hi All:

I am trying to use Excel VBA macro to dynamically print certain number
of pages.

Let me explain:

I have a print button in the second page of my spreadsheet. When I
click this button I have to start ptinting from second page onwards .
But the end is dynamic. Depending on the number of records available it
can vary (i.e can be 10 records or 40 or 30 or2 etc).

I would really appreciate if some one could help me with this scenario.


I very badly need this in my project.

Thanks in advance

nsgargya


--
nsgargya
------------------------------------------------------------------------
nsgargya's Profile: http://www.excelforum.com/member.php...o&userid=27632
View this thread: http://www.excelforum.com/showthread...hreadid=471511



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 Pivot tables - how to "show pages" RosH Excel Discussion (Misc queries) 1 August 9th 05 01:17 PM
Excel printing problem Winnie Excel Discussion (Misc queries) 1 August 3rd 05 09:59 PM
How can I mirror pages in an excel document for printing? mirroring Excel Discussion (Misc queries) 4 March 29th 05 11:55 PM
Printing in Excel dgordon30 New Users to Excel 3 February 15th 05 10:41 PM
print excel columns on less pages a_ryan1972 Excel Discussion (Misc queries) 1 February 9th 05 05:41 PM


All times are GMT +1. The time now is 01:34 AM.

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"