+ Reply to Thread
Results 1 to 5 of 5

Save as PDF in a difined directory

  1. #1
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Save as PDF in a difined directory

    Hi all,

    I have got a macro to create a PDF but it always saves as the same name i.e. C:\pdf\RFI pdf.

    I have to rename the file as something different each time, the ref is contained in cell C2 of the active worksheet.

    Is there a way I can save the pdf and it saves as a named file which refers to a ref in cell C2 of the worksheet?

    I have an issue with where to place the code for the following! I have been told to insert this code but cant figure out where!

    & Sheets(Sheet Name Here).Range("C2").Value


    can you highlight where i need to add the code?
    the sheet mane is RFI ENQ.

    Sub PDF()
    '
    ' PDF Macro
    '

    '
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "H:\Documents\1_CAPABILITY INSERTIONS\30_RFI's\RFI.pdf", Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True
    End Sub

    thanks

    D

  2. #2
    Forum Contributor
    Join Date
    08-18-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    490

    Re: Save as PDF in a difined directory

    Please Login or Register  to view this content.
    I have this code which saves as excel file with Password.
    If you wish to remove Password then delete
    Please Login or Register  to view this content.
    File format you can change to "Pdf"

  3. #3
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Re: Save as PDF in a difined directory

    hi, handy code but not what im after.

    thanks

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Save as PDF in a difined directory

    You should put your code in code tags

    Please Login or Register  to view this content.

    or change nametosave=Range("C2").value
    to nametosave=Range("C2").value & ".pdf"

  5. #5
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Re: Save as PDF in a difined directory

    I’m really new at using code, don’t really understand much as yet so I record a macro but it’s not giving me everything I need, I’ll get there slowly. I don’t know what or where to place code tags. I’ll try this when I get back to my pc.

    Thanks for your help

+ 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. [SOLVED] Need to loop a macro to save images to file - but save to user defined directory.
    By superfurry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2015, 07:49 AM
  2. Save as method. Save in a specific directory
    By sherry_1991 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 12:28 PM
  3. Save to Different Directory
    By longbow007 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-03-2010, 05:46 AM
  4. Replies: 3
    Last Post: 06-11-2009, 07:08 PM
  5. [SOLVED] save in directory
    By rlm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2006, 01:30 AM
  6. user difined inputbox
    By Brian Matlack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2005, 04:04 PM

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