Results 1 to 3 of 3

Thread: Excel page breaks and print settings

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    2

    Excel page breaks and print settings

    I'm flying blind here, no previous VB programming experience before I needed to get this project done!

    I am starting with an dump of data exported to Excel which includes rows ordered by a location ID and a group ID (several groups for each location). What I need is to print the data out for each group, with the groups separated on individual pages (groups may overflow to more than one page also). Ex: group 1 has 20 members, fitting on page 1. Group 2 has 50 members, which takes up a page and a half (pages 2 and 3). Group 3 should be printed starting on page 4.

    To achieve this I have created a macro which uses a variable to store the group ID and then goes line by line to check if the next row is in the same group. It copies all members of one group to a separate sheet, adjusts the print margins to include all the data, and prints the group. Then it clears the sheet and proceeds with the next group.

    My question is as follows. Is there any way to get this printed as ONE print job? Other than making a new sheet for each group? To simplify printing I coded the print setup into the macro, but it sends each group as its own print job. I need users at other computers to be able to print this also, and printer installation settings vary. If I could bring up the print dialog ONCE, they could choose their printer of choice and also put in their copy code. We use print job accounting and our IT guy is wary of disabling it for this one purpose.

    Hope this is not too confusing! If anyone needs clarification or code excerpts, please let me know.

    THANKS!

    [Edit: I suppose an easy way to do it would be to keep all the data on one sheet and set the page breaks after each group. Is there any VB command to do this in Excel?]
    Last edited by l7eslie3; Jul 10th, 2007 at 09:43 PM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    2

    Re: Excel page breaks and print settings

    Bump for my edit..thankee

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Excel page breaks and print settings

    insert a page break after each group

    oops, just read your edit
    try to recod a macro to insert page break to get some sample code to work with

    there is a way to create a sheet that has a link to several other sheets for printing mutiple sheets at once, but it is a few years since i did that
    Last edited by westconn1; Jul 11th, 2007 at 12:02 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width