+ Reply to Thread
Results 1 to 7 of 7

Macro to save as PDF

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Norwich
    MS-Off Ver
    Excel 2010
    Posts
    53

    Macro to save as PDF

    Hi,

    I am looking for a macro which will save a sheet(named AF) as a PDF. The excel workbook will already be saved in a folder as a specific name(e.g 1554) and I would like this PDF to be saved as that name but with AF added to the end - so for example it will be saved as 1554AF. Its also needs to be saved in the same folder as the excel sheet is saved in.

    Thanks in advance.

    Jon

  2. #2
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    Re: Macro to save as PDF

    Hi,

    Use this function

    Please Login or Register  to view this content.
    Thanks!
    Kiran

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to save as PDF

    Hi, Kiran,

    Use this function
    I would call the code a procedure or a macro rather than what I would call a Function (which is supposed to deliver back anything for me). And I guess you would have to work on the filename as it should represent the name of the folder as well as the name of the sheet.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    Re: Macro to save as PDF

    Hi,

    Please use this macro.

    Please Login or Register  to view this content.
    Thanks!
    Kiran

  5. #5
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    Re: Macro to save as PDF

    hahaha, thanks for letting me know

    As a habit of programming I was calling as a function instead of macro.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to save as PDF

    Hi, Kiran,

    your second macro still doesn´t do what OP is calling for.

    Please Login or Register  to view this content.
    As a habit of programming
    Maybe change the habit?

    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    Re: Macro to save as PDF

    Thanks for suggesting me and the way to improve my code

+ 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. Macro to Save current XLS, then to save as a CSV. Then close CSV and reopen XLS
    By cricker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-02-2014, 06:17 AM
  2. Macro to Auto save a backup copy in a seperate location OR save file with a pop up
    By kdsanderson30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2014, 12:38 PM
  3. how to specify a file save path to a save macro
    By Solidstan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-04-2013, 05:33 PM
  4. Macro with cell reference as a name, but prompt for save location and save as csv
    By tomham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2012, 06:21 PM
  5. where can i find macro codes for various functions such print, save and save as
    By fellayaboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2011, 02:06 AM

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