+ Reply to Thread
Results 1 to 3 of 3

VBA to print numerous times an excel sheet

  1. #1
    Registered User
    Join Date
    03-30-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    2

    VBA to print numerous times an excel sheet

    Dear all,
    First of all, thanks for any inputs/helps

    I would like to create a macro to print an excel-sheet multiple times (based on input)
    I have a file with the following sheets:
    1) Table info
    2) Letter

    The table info can be seen as a big database. On the sheet Letter, i have some text and a number of vlookups to the "table info" sheet.

    On the letter-sheets, in cell L1 holds the unique line-number, that fills the "letter" fully with the info i would like to print.
    As I will be printing over 1000 letters, I have a start and end number in cells L4 (start) and L5 (end).

    The macro that I would need (and I'm failing to create) should do the following when running.

    It should look to the start number in L4. (say 10)
    Put this number in L1 (so 10)

    Print the letter (on Letter-sheet)

    Put in L1 the next number following (so 11)
    Print the letter (on Letter-sheet)

    Put in L1 the next number following (so 12)
    And so on, and so on, untill it reaches the End number, as stated in L5 (end).

    ----
    So the number in L1 will always be in between L4 and L5.

    It sounds very simple...when reading a again, unfortunatly I'm failing... any help is most welcome!
    thanks,

    Gerbs

  2. #2
    Registered User
    Join Date
    03-30-2012
    Location
    Germany
    MS-Off Ver
    Excel 2003/2010
    Posts
    9

    Re: VBA to print numerous times an excel sheet

    Hello Gerbs,

    I guess I have a similar Problem with looping a Printjob a set amount of times. So I can only throw out some ideas for a solution:

    Maybe you can use a Loop counter that uses ur cell L4 as LBound and L5 as UBound. Each time it Counts it replaces L1 with the current count and prints.

    The macro I use to Print is the following:

    Please Login or Register  to view this content.
    The Standart Printer will be used. I may also suggest, to prevent infinite print loops, to set the Windows XPS Printer as standart, since it stops everything when cancel.

  3. #3
    Registered User
    Join Date
    03-30-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VBA to print numerous times an excel sheet

    Hi,
    Well i'm getting there, after spelling my issue out... i tried it again and now have the following:

    For i = Cells(4, 12) To Cells(5, 12)
    Cells(1, 12) = i
    Calculate

    'Print command goes here
    Next i

    Application.ScreenUpdating = True
    MsgBox ("Congrats it worked!")
    End Sub

    So, i believe this works for me

+ 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