+ Reply to Thread
Results 1 to 11 of 11

Exporting Excel to Pdf with respective Sheet Names

  1. #1
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Smile Exporting Excel to Pdf with respective Sheet Names

    Hi Experts!

    I am trying to export my excel sheets to different excel workbooks with their respective names in PDF format with the help of following VBA Code. It works well when all the sheets are visible. On the other hand it wont work if any sheets are hidden. Could any expert fix it for me. I would like to select some sheets and export it. Hope i will get a nice advise at the earliest.

    Please Login or Register  to view this content.
    Thanks in Advance!!

  2. #2
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Exporting Excel to Pdf with respective Sheet Names

    Hi Paul,

    I'm no expert but you could simply unhide the hidden sheets before exporting them. Substitute the names of your hidden sheets in the Array where I've got "Green", "Blue". If you want to hide the sheets again after exporting then keep the 'Rehide Hidden Worksheets' code. If you don't mind them remaining visible then you can delete that part of the code. Are your sheets just Hidden or Very Hidden, if the latter replace xlSheetHidden with xlSheetVeryHidden if you do want to hide them again after exporting.

    Please Login or Register  to view this content.
    I hope that gives you what you need...
    Last edited by HangMan; 10-15-2015 at 09:34 AM.
    Thanks,
    HangMan

    You can say "Thank you!" by clicking Add Reputation below the post.
    Please, mark your thread [SOLVED] if you are happy with the solution.

  3. #3
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Exporting Excel to Pdf with respective Sheet Names

    Dear HangMan,

    Appreciate your effort and advise. But as it is an important workbook that contains more than 90 worksheets with specific project names it would not be easier for me to rename them with green or blue. Few sheets are hidden and some are very hidden too. I will look forward for more suggestions! Thanks again for your contribution.

    Regards,

    Paul Cherian.

  4. #4
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Exporting Excel to Pdf with respective Sheet Names

    I wasn't suggesting renaming the worksheets, but substituting your actual worksheet names where I've used "Green", "Blue" in the sample... However, I'm sure someone will have a much simpler solution...

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Exporting Excel to Pdf with respective Sheet Names

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Exporting Excel to Pdf with respective Sheet Names

    Dear Kenneth,

    Thanks for your advise. However when I tried to run your modified codes, getting a Run time error 53 saying File Not Found. Could you please look in to this error!

    Regards,

    Paul Cherian.

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Exporting Excel to Pdf with respective Sheet Names

    Change = to <> in:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Exporting Excel to Pdf with respective Sheet Names

    Thanks Kenneth...! Code is working! But it is exporting hidden worksheets also. Do you have any fix for this?

  9. #9
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Exporting Excel to Pdf with respective Sheet Names


  10. #10
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Exporting Excel to Pdf with respective Sheet Names

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Exporting Excel to Pdf with respective Sheet Names

    Oh My God !!! Perfect!!!! Thanks a Lot Dear Kenneth!!! :-) God Bless!

+ 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. Exporting from Excel to another sheet VBA
    By Degurk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2015, 03:45 PM
  2. Can i search and copypaste to there different respective column Names
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-06-2015, 03:05 AM
  3. Replies: 2
    Last Post: 07-22-2014, 07:44 AM
  4. Need help in exporting an excel sheet
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2012, 06:27 AM
  5. Save All Open Excel Windows after respective cell names
    By Craig2097 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-24-2009, 10:24 AM
  6. Replies: 0
    Last Post: 04-30-2005, 02:06 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