Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 Pivot tables - how to "show pages" | Excel Discussion (Misc queries) | |||
Excel printing problem | Excel Discussion (Misc queries) | |||
How can I mirror pages in an excel document for printing? | Excel Discussion (Misc queries) | |||
Printing in Excel | New Users to Excel | |||
print excel columns on less pages | Excel Discussion (Misc queries) |