+ Reply to Thread
Results 1 to 12 of 12

How to create Pdf filename base on ws Range.Value

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    How to create Pdf filename base on ws Range.Value

    Hi,
    There's several post in this forum that I can use for my work but I don't know how to make the file name base on the ws range.

    Please Login or Register  to view this content.
    Regards,
    tt3
    Last edited by tuongtu3; 12-10-2012 at 10:11 PM. Reason: Solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: How to create Pdf filename base on ws Range.Value

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to create Pdf filename base on ws Range.Value

    Hi TMS<
    I tried but it didn't work. Can you take a look.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: How to create Pdf filename base on ws Range.Value

    In what way does it not work? Have you got a Documents folder at the root level of Drive C:\


    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to create Pdf filename base on ws Range.Value

    Hi TMS,
    Yes, I did have a Documents folder at the root level of Drive C:\

    In cell B3 = Reference# xxxxx
    and it work if I entered "Filename:="C:\Documents\Reference#" & ".pdf"

    Regards,
    tt3

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: How to create Pdf filename base on ws Range.Value

    I suggest you post a sample workbook with some typical data and the code you are working with.


    Regards, TMS

  7. #7
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to create Pdf filename base on ws Range.Value

    Hi TMS,
    Please take a look at the file in attached.

    Regards,
    tt3
    Attached Files Attached Files

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: How to create Pdf filename base on ws Range.Value

    Try:

    Please Login or Register  to view this content.

    Regards, TMS

  9. #9
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to create Pdf filename base on ws Range.Value

    Hi TMS,
    Still got an error message "Compile error: Variable not defined" and "Dest =" was
    highligh. I tried the code on other win7 and that works.
    Thank you very much for your time and help.

    Regards,
    tt3

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: How to create Pdf filename base on ws Range.Value

    Clearly, Dest is defined ... did you copy and paste the code or did you retype it?

    I tested it on a Windows 7 machine with Excel 2007. And i set up a folder structure on my C: drive to emulate your environment. I then copied and pasted the code from the VB Editor into the thread.

    Sorry it doesn't work. I can only assume it is something to do with the MAC.

    Regards, TMS

  11. #11
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to create Pdf filename base on ws Range.Value

    Hi TMS,
    Thank you very much for your time and help.

    Regards,
    tt3

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: How to create Pdf filename base on ws Range.Value

    You're welcome

+ 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