+ Reply to Thread
Results 1 to 2 of 2

Need an iterative cell entry and print for entire list of values.

  1. #1
    Forum Contributor
    Join Date
    07-09-2008
    Location
    Dallas
    MS-Off Ver
    2007
    Posts
    121

    Need an iterative cell entry and print for entire list of values.

    I need help programming something that will do an iterative cell entry and print one sheet for every item found in a list (list generated by SQL query) until the entire list has been printed.

    Spreadsheet tabs are:

    Chart
    Data (single cell entry in cell B5)
    TerritoryList (pertinent values in column A)

    SQL query on the TerritoryList returns a list of all sales territories. Basically, for each of these territories (about 120), I have to enter the territory ID (from column A) into cell B5 on the Data page (which updates sales/summary/quota information for that territory, and then print the Chart page. Then move to the next territory on the TerritoryList, put its code in cell B5 on the Data page, print the chart, rinse, repeat.

    Would really like to be able to macro/VBA this, of course.

    To possibly complicate things, the output is to PDF; I can set the printer to print to PDF first, so that printing each chart goes there automatically, but it does prompt for a name for the pdf file to be saved (so the macro/VBA would need to incorporate that as well, incorporating the territory name into the file name).

    Any thoughts/guidance? Thanks!

  2. #2
    Registered User
    Join Date
    03-08-2007
    Posts
    93

    Iterative printing

    Something like this should do the trick:

    Please Login or Register  to view this content.
    I don't still have a PDF generator, so I can't give you the exact code, but if you set your printer to normal (i.e. a physical machine), then turn on your macro recorder and run through the process one time, you can retrieve the system designation for your PDF printer and identify where in the code to insert "tFileName". (Or post the resulting macro back for more specific help.)

    Hope this helps

    SAE

+ 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