+ Reply to Thread
Results 1 to 2 of 2

Printing subset of pages dynamically using excel macros

  1. #1
    Registered User
    Join Date
    09-28-2005
    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

  2. #2
    Ron de Bruin
    Guest

    Re: Printing subset of pages dynamically using excel macros

    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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1