+ Reply to Thread
Results 1 to 2 of 2

creating multiple PDFs by looping through number list-- help needed

  1. #1
    Registered User
    Join Date
    10-23-2019
    Location
    Texas
    MS-Off Ver
    13
    Posts
    1

    creating multiple PDFs by looping through number list-- help needed

    The code below is part of a macro being used to create a list of numbers and then loop through those numbers one at a time, place the number into cell I1 which is linked to numerous other sheets. Each of those sheets has a formula in cell Z1 that sets to "Yes" or "No" depending on if the current number in the list is on that sheet. If it is set to Yes, the macro is supposed to select each of those "yes" sheets and then create a PDF file, and then loops to the next number in the list.
    There are two problems I haven't figured how to get around yet. First, the first loop through works correctly, but each subsequent loop keeps adding sheets that should not be marked "Yes". Second, it is also selecting the sheet the macro is running from, which I do not want it do.
    Any suggestions are greatly appreciated!

    Please Login or Register  to view this content.
    EDIT: Fixed the first issue by selecting another sheet at the end of the main loop. Now just need to keep it from adding the activesheet to the PDF files.
    Last edited by davidy1968; 10-24-2019 at 10:54 PM.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: creating multiple PDFs by looping through number list-- help needed

    Hi and Welcome to ExcelForum,

    Sorry for the late response.

    Try adding the code in red:
    Please Login or Register  to view this content.
    Lewis

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help needed with looping through multiple folders and calling macros
    By maym in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-18-2017, 09:22 PM
  2. Looping through name range and create one pdf instead of individual pdfs
    By igoodable in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2016, 08:13 AM
  3. looping through folders - saving xls files as PDFs
    By Hugh Jass in forum Excel General
    Replies: 1
    Last Post: 05-11-2016, 06:06 PM
  4. looping through folders - saving xls files as PDFs
    By Hugh Jass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2016, 06:06 PM
  5. Creating automating multiple pdfs files
    By tanababa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2016, 01:11 AM
  6. Run-time Error 9 when creating PDFs
    By Konsti1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2013, 07:06 PM
  7. Macro Needed to Loop, Save, and Name Excel Files as PDFs
    By ahkarchem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2012, 10:46 AM

Tags for this Thread

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