Excel VBA Macro: Save Active Sheet As PDF (Based on Cell Value)

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

ความคิดเห็น • 30

  • @greggowaffles
    @greggowaffles  3 ปีที่แล้ว

    Repeat this process automatically for multiple items in a list 🤓😎: th-cam.com/video/CtAgAlJjleU/w-d-xo.html

  • @ecomundienergiasolar9769
    @ecomundienergiasolar9769 3 ปีที่แล้ว

    Cheers from Brazil! Been trying this for hours and only your video could solve this problem!

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      Niiice!! So glad to hear that!!

  • @vamanshenoy938
    @vamanshenoy938 2 ปีที่แล้ว

    Thanks for the simple code. Wonderful.
    1)What if I want to select a few columns,not all.
    2) I want the row heading on each page.
    3) I want to increase the font size and height of the rows as they are too small to read other wise.

  • @jayveedecastro9748
    @jayveedecastro9748 3 ปีที่แล้ว

    Helpful video. I was wondering if it is possible to put the path file to a certain cell so we dont have to edit through vba if we want to change the path file

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      Thanks! Yup, you can set the Filename:= a cell that has the file path in it

  • @MantraGarala
    @MantraGarala 2 ปีที่แล้ว

    Great explanation

  • @federicoweninger60
    @federicoweninger60 ปีที่แล้ว

    Hi, great totorial. Is there a way to ask VBA to ask every time where we want it saved?
    If I try to print twice the same file (same name), it goes into debug error. Thanks

  • @sallytong241
    @sallytong241 3 ปีที่แล้ว

    It was a great video. I am wondering if you can save the pdf file with more settings, like A4 size, automatically reduce the size to fit in one A4 page, etc. Thank you.

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว +1

      thanks! yup! here are a couple of links with some examples:
      stackoverflow.com/questions/33127693/all-columns-of-excelsheet-are-not-fitted-in-same-page-of-pdf-while-converting-u/33757074
      docs.microsoft.com/en-us/previous-versions/office/ff841253(v=office.15)?redirectedfrom=MSDN
      hope that helps!

  • @adybmwgmail
    @adybmwgmail 2 ปีที่แล้ว

    Is this the same when using on mac. I have tried many times and unfortunately it throws up errors ?

  • @anjinoureddine1513
    @anjinoureddine1513 4 ปีที่แล้ว

    thank you very much,

  • @Huzzimurt
    @Huzzimurt 3 ปีที่แล้ว

    This is perfect. However my question is, what if I send the file to someone else? They should be able to save wherever they want. Can you help me with this please?

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      thanks! you can add a button, so that when the person clicks it the macro will run

  • @hrithikzgirl83
    @hrithikzgirl83 2 ปีที่แล้ว

    What if your coworker had access to the same file and wanted to run the macro from his computer. How would you add "UserName", instead of "greggowaffles" to VBA so the macro runs regardless of whether you or your coworker runs it?

    • @greggowaffles
      @greggowaffles  2 ปีที่แล้ว

      You can use a shared folder or you can do something like this where the user selects the saved location: th-cam.com/video/f0UMMKCzVrI/w-d-xo.html

  • @eren2835
    @eren2835 3 ปีที่แล้ว

    Hi, Is there anyway to make certain values bold when saving as pdf

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      yup! you can make values bold on the excel sheet itself or from the code. apologies for the late reply

  • @kgn_sergei
    @kgn_sergei 2 ปีที่แล้ว

    Ты мой спаситель, я 3 дня маялся, не знал как сделать правильно

  • @mahirbadanagki
    @mahirbadanagki 3 ปีที่แล้ว

    could you please make one by letting the user be able to define the location of saved file by window dialog instead of writing the path?

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      Yeah, I’ll do that ASAP! Thanks

  • @joyceng2353
    @joyceng2353 3 ปีที่แล้ว

    Hello there, I have a tricky one I am hoping you could please help solve. I have 2 sheets, Sheet 1 has 20 names, Sheet 2 has a letter to say "______ agrees to attend this training". I am wishing to save Sheet2 as 20 multiple PDFs with 20 different PDF names according to Sheet1. ABC agreed.pdf, DEF agreed.pdf, GHI agreed.pdf and so on. I would appreciate very much if you could help!

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว +1

      hello! apologies for the late reply. you can use a loop that goes through each of the 20 names on Sheet1, and during each iteration it will fill in the blank on Sheet 2 with the current name, save as pdf and go on to next one. i do something similar in this video: th-cam.com/video/7Chuqz5M65U/w-d-xo.html

    • @joyceng2353
      @joyceng2353 3 ปีที่แล้ว +1

      @@greggowaffles Thank you so much!

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      @@joyceng2353 hey Joyce! just made a video on this btw: th-cam.com/video/CtAgAlJjleU/w-d-xo.html

  • @Kakarot_Son_Goku
    @Kakarot_Son_Goku 4 ปีที่แล้ว

    Nice work, keep it up. :)

  • @kenbelen3470
    @kenbelen3470 3 ปีที่แล้ว

    how do i use it using a command button?