+ Reply to Thread
Results 1 to 7 of 7

Multi-sheet Printing

  1. #1
    Registered User
    Join Date
    07-16-2007
    Location
    San Francisco, CA
    MS-Off Ver
    2010
    Posts
    93

    Multi-sheet Printing

    Hi guys, I know that there is an easier and shorter way of doing this;
    Please Login or Register  to view this content.
    and I am think along the lines of 2 for and next statement however I am unclear of the syntax for the sheets, to get it to be variable.
    Thanks James


    Please Login or Register  to view this content.
    Last edited by jwongsf; 03-05-2009 at 10:35 AM.

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Multi-sheet Printing

    You could do it this way (I haven't put all the sheets in the "array" statement but just carry on with the format

    Please Login or Register  to view this content.
    Last edited by tony h; 03-03-2009 at 05:30 PM.

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Multi-sheet Printing

    jwongsf & tony h,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    07-16-2007
    Location
    San Francisco, CA
    MS-Off Ver
    2010
    Posts
    93

    Re: Multi-sheet Printing

    Okay since I do not understand about the coding issue, then Let me try this is plain thoughts.
    I would like to create a macro that woudl printout work sheets 1 -16 depending on whether the page number is used, as denoted by a particular cell value. I am leaning towards 2 for and next statement, one for the worksheet and one to compare the cell value, I am unclear as to how to setup the for and next in conjunction with ths worksheet(1) so that I can get it to variable number to change.
    Thanks
    James

  5. #5
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Multi-sheet Printing

    I will try and explain wha I have done. The main part is to take the original code:
    Please Login or Register  to view this content.


    and replace it with a loop:
    Please Login or Register  to view this content.

    So how does it work? Well: in the original repeating sections there are three items that change. I have marked them in red below:
    Please Login or Register  to view this content.
    These I have picked out and placed in the nested array:
    First block:
    Please Login or Register  to view this content.
    Second block:
    Please Login or Register  to view this content.
    and so on.

    These blocks are then bundled into another array:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Then the remaining code uses this data:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    basically steps through each block of data setting the variable var to contain the data.

    var now contains an array of three items. The three items are identified as: var(0), var(1), and var(2). Which for the first block will contain :
    Please Login or Register  to view this content.
    So you can see, I hope, that as the variables contain the values from the block the code will look like the original:

    Please Login or Register  to view this content.
    I hope this helps
    Last edited by VBA Noob; 03-04-2009 at 06:28 PM.

  6. #6
    Registered User
    Join Date
    07-16-2007
    Location
    San Francisco, CA
    MS-Off Ver
    2010
    Posts
    93

    Re: Multi-sheet Printing

    Thanks Tonyh and for the explanation, also sorry for the infraction.

  7. #7
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Multi-sheet Printing

    Glad to have helped. Have fun.

+ 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