+ Reply to Thread
Results 1 to 5 of 5

Autoname .PDF conversion to the name of the .xlsb from which it came

  1. #1
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Autoname .PDF conversion to the name of the .xlsb from which it came

    I have a macro (see code below) that automatically converts the print area of the a worksheet into a pdf file, and then automatically saves the PDF into a specified location, and finally saves the portion of the excel file that affected the print area.

    Right now I have to specifically name "filename" whatever I want the PDF to be saved as. Since I have to replicate my workbook several times, it would be very convenient if the code could autoname the PDF with the same name as the .xlsb file from which it was made. For instance, if the excel file's name is "Doe, John.xlsb", then the code auto saves the PDf as "Doe,John.pdf" when that macro is clicked. This would save a tremendous amount of time of renaming "filename" for 80 people for 26 pay cycles (2080 times!).


    Please Login or Register  to view this content.
    Last edited by jonvanwyk; 06-06-2011 at 02:20 PM.

  2. #2
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    181

    Re: Autoname .PDF conversion to the name of the .xlsb from which it came

    I have a macro that someone a long time ago wrote for me that takes every "active" tab, makes a copy of that worksheet in that specific tab, saves that file to match the name on the tab as it's own specific file, emails it to the person identified in that file, then deletes the file from the memory.

    Obviously this is more than what you want but maybe you can take the pieces of the code and adapt it to work with your macro. I personally do not write code but I can follow along with it. Below is the code and as I said you may be able to Frankenstein something together. Hopefully it works. Good luck:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Autoname .PDF conversion to the name of the .xlsb from which it came

    I specifically need to have the .pdf file autonamed to match the name of the .xlsb file from which it was created. cheddartheif's code needs too much modification to be able to use it (at least for me to modify).

    Anyone else have any ideas?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Autoname .PDF conversion to the name of the .xlsb from which it came

    This might work
    Please Login or Register  to view this content.
    I'm not sure what this is

    FY2012\27 = 061712 - 063012
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Autoname .PDF conversion to the name of the .xlsb from which it came

    @royUK

    That worked perfectly. You have no idea how much work you just saved me!

    Thanks!

+ 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