+ Reply to Thread
Results 1 to 8 of 8

Issues with Macro to create individual pdf files for each item on item validation list

  1. #1
    Registered User
    Join Date
    06-10-2021
    Location
    Tulsa, OK
    MS-Off Ver
    360
    Posts
    4

    Issues with Macro to create individual pdf files for each item on item validation list

    I have a dashboard that I need to export to pdf for each data validation item on the list. I have some code that does this but I am having some issues with it. I wrote an xlookup so that each loop through the data validation list it will populate the file name in a different cell. I then want to use that cell when I write the file name. The m= tells it that's where the data validation list is at, while I thought the c.Value that is used for sName to write the file name. When I change that from E3(where data validation list is) to Q3(where the xlookup to get the file name I want to use) and I run it again, it takes the value in cell Q3 and rewrites it with what should be in cell E3 and the value in E3 stays the same so it ends up saving the same data over and over with different names. I want it to parse through each individual name on the list in E3 and save it using the value that is returned in the xlookup in cell Q3

    Please Login or Register  to view this content.
    Last edited by maldo81; 06-10-2021 at 10:16 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    Please post an example file. See the yellow banner at the top of this site
    Messages have been translated from Dutch to English by means of google translate.

  3. #3
    Registered User
    Join Date
    06-10-2021
    Location
    Tulsa, OK
    MS-Off Ver
    360
    Posts
    4

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    I apologize, I hope I added the attachment correctly.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    Merged cells and especially in combination with VBA is never a good idea. Maybe you mean this?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-10-2021
    Location
    Tulsa, OK
    MS-Off Ver
    360
    Posts
    4

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    The pdf files have to be sent to different providers and they use a program that automatically catches the files for each individual and sends them their files. The format that each of those files has to follow is
    RVU_Bonus_Report_
    Previous Month as yyyymm
    _
    the provider name as listed in column B of the File names sheet

    so RVU_Bonus_Report_PreviousMonth_ColumnBProvName

    The provider name has to be as column B because they use just last name if there are no other doctors with that last name, and if there are other doctors with the same last name then last name first two letters of first name. The problem is there are hundreds of doctors with and only some of them get a bonus so those last names have to be written as in column b.

    The reason for the merge was so that I could catch the static portion (RVU_Bonus_Report_), the previous month (which changes every month) and the static Provider name using their full names.

    I was then trying to do an XLookup on that merge based on the provider name and put that in cell Q3 so that I could use that as the file name.

    Both of those codes work great at creating a pdf for each individual provider, but they both use the full provider name to create the file name.

    What I need is for the file name when saving to show up as:

    RVU_Bonus_Report_202105_Aly

    The month to use the previous month so I can run the report each month

    And to use the shorter version of the providers name that is used in the file names sheet

  6. #6
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    Long story. You can still easily change the file name here:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-10-2021
    Location
    Tulsa, OK
    MS-Off Ver
    360
    Posts
    4

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    Sorry I finally got what you mean logically. Basically it was to do the cell merge in the VBA code where you pointed out, in case anyone works with this I copy pasted how I wanted the names from the File Names sheet into the Providers sheet and under the ExportAsFixedFormat I told it to find the name under column 2 instead of column 1 where the regular names are at. Then I defined the last month as lm below the ar definition and referenced that as well under the ExportAsFixedFormat line. The resulting code is below.

    Thank you Vraag en antwoord for your help! I am gonna mark the thread as solved. I am new to this forum so I will look to see if there is a place to leave you a good review or something that gives you credit for helping solve the issue.

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Issues with Macro to create individual pdf files for each item on item validation list

    Thanks for the feedback. There is an add reputation button. But that doesn't bother me.

+ 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. Replies: 6
    Last Post: 06-23-2019, 11:07 PM
  2. Macro that runs through and enters each item in a Data Validation List
    By MrPartial in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2016, 03:34 PM
  3. [SOLVED] Running A Macro When Any Validation List Item is Selected
    By Pony08 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-21-2014, 11:04 AM
  4. macro to select each item in data validation list
    By Olivia Wong in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-30-2013, 01:59 PM
  5. Macro to select an item from a data validation list
    By blindedbythepj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-12-2012, 03:53 PM
  6. Macro to select an item in a Validation List
    By emwhite in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2010, 10:41 AM
  7. Create new sheet for each individual item
    By Javan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-13-2008, 02:03 PM

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