Save Excel Sheet as PDF with Simple Macro - ExcelVbaIsFun

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

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

  • @PiXpilot_Shridhar
    @PiXpilot_Shridhar 6 ปีที่แล้ว +1

    I'm Beginner in VB, Its very helpful in my off work. Thank you a lot

  • @krsathyamech
    @krsathyamech 6 ปีที่แล้ว +2

    Hi.... Really thanks for this video, I was finding this one line for whole day, Finally i made it because of this video, Thanks for making my day peaceful.

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  6 ปีที่แล้ว

      So glad it helped. You're very welcome!!

  • @pieterlwd
    @pieterlwd 6 ปีที่แล้ว +2

    If I want to make the filename dynamic like celvalue D13 followed by cellvalue D12 + date of today. How sould I add this in to the Macro?

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

      Did you manage to figure dynamic name out?

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

    Sir Thanks, It is good. Can we save in PNG format instead of PDF & other things in coding are OK.
    Waiting for your reply.
    Thanks

  • @TheFamily765
    @TheFamily765 7 ปีที่แล้ว +3

    When I made the macro. It only overwrites it when I save. How do I make it save a whole new file name every time I run the macro? Thank you.

  • @excelisfun
    @excelisfun 9 ปีที่แล้ว

    Thanks for the video!!

  • @krn14242
    @krn14242 9 ปีที่แล้ว

    Thanks Dan.

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

    Perfect tutorial, thanks.

  • @Pankaj-Verma-
    @Pankaj-Verma- 4 ปีที่แล้ว

    Thank you so much for your kind help!

  • @marymadyarova5917
    @marymadyarova5917 6 ปีที่แล้ว

    Hello, do you know how to get and change coordinates of a specific text (Ex. "Figure 1" in the right coner of page, for example) on a PDF page. PDF page has only text. I am writing VBA code and cannot figure it out.

  • @pur3p
    @pur3p 9 ปีที่แล้ว

    Hi Dan ExcelVbaIsFun ! I've always lookup your videos throughout my learning process of Excel!
    I was wondering if you could help me in my situation. I currently have a Pie Chart, and i want my Pie Chart to rotate 360 Degree whenever my checkbox is ticked. When unticked, the Pie Chart will stop at its original position. Is this even feasible? If it is, hope you could give me some advice!
    Cheers!
    Cleon

  • @stijnjohanneswilhelmustjon6079
    @stijnjohanneswilhelmustjon6079 8 ปีที่แล้ว

    Hi there, great explanation! I want to do the same thing; wrote a macro to convert a table and the graph it creates to a 1 page PDF. For some reason, it will save the table, though it won't save the graph. Strange right? I do this on my work, so when I switch computers with my colleague and log in to my own account, it suddenly does work and I have table with graph on a 1 page PDF. Unfortunately it has to work on my PC as well (as we our own in the office), do you know what I can do? Thank you so muc in advance!

  • @benmathews1086
    @benmathews1086 7 ปีที่แล้ว +1

    Can you please explain on how to have the file name change based on a cell in the actual document? This is what I am struggling with.

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

      hi i am just wondering if you know how to do this now?

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

      @@rowanisironman3358 I'm also wondering the same, any luck getting it to work?

  • @genevievewilson9271
    @genevievewilson9271 5 ปีที่แล้ว

    Hello! Quick question, when I print my excel sheets to the pdf it cuts off the last three columns and prints them onto a separate page. How can program my code to force a "fit to page"/"shrink to fit" or at least have some control over what is cut off?

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  5 ปีที่แล้ว

      Hi Genevieve, If you go to print preview or press Ctrl+P, you'll see the bottom option is Scaling. Just change this from No Scaling to Fit All Columns On One Page. Should work.
      Thanks
      Dan

  • @faizhussainbond
    @faizhussainbond 9 ปีที่แล้ว +6

    Hi... Your videos have really helped me in my day to day office work .... Can you please help make a video on converting PDF to excel... Or how to link monarch with excel VBA.... Using a macro... And run the query... Thanks

  • @xXWilson234Xx
    @xXWilson234Xx 8 ปีที่แล้ว

    This works great, I have my spreadsheet saving as a PDF file using a button, however, how do I get it so it saves a new file every time I click it instead of saving over the previous file?? please help

  • @tuplisss
    @tuplisss 9 ปีที่แล้ว

    Thanks! Nice addition would be like a msgbox which asks you to enter the wanted name for the file.

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  9 ปีที่แล้ว

      Search my channel for InputBox bro. That will allow you to receive their input easily. Dan

    • @kazz5742
      @kazz5742 9 ปีที่แล้ว

      ExcelVbaIsFun Is it possible to download pdf documents from the internet MrExcelVba, if so can you put up a video tutorial.
      Thanks and your videos are awesome bro.

  • @JonMichael1087
    @JonMichael1087 5 ปีที่แล้ว

    very helpful but can you not record your trial and error process? thanks

  • @sinanbasha-2564
    @sinanbasha-2564 5 ปีที่แล้ว

    Hi.
    pls can u help me with ( doing auto organization chart with vba ) .

  • @asadost258
    @asadost258 6 ปีที่แล้ว

    Hi sir
    I am new to Excel vba & I often view yr vids, i need help for printer. I have to 2 computer in my office 1 is Prh-Pc & 2 is Asad-pc. Epson Printer is installed on 1pc & another receipt printer installed no2 PC. My Epson printer is connected to no2pc via dongle (same network). The problem is I want to change my default receipt printer to Epson Printer, when I save the PDF file with command button it saves in receipt printer format which is very long, I want to change to Epson printer in A4 size.how to code for it

  • @yiwenfoong304
    @yiwenfoong304 8 ปีที่แล้ว

    Thank you so much! Works perfect

  • @taylorbattistella7610
    @taylorbattistella7610 9 ปีที่แล้ว

    Thanks, but i can't get it to work properly, because when i am on the visual basic editor, i cannot seem to gt the code to come up at the bottom. WHY?
    Thanks so much!

  • @ashishmaheshwari7891
    @ashishmaheshwari7891 9 ปีที่แล้ว +1

    Hey.. Suppose. I want to save the file name as "Standard-Today's date". How can i make it dynamic? I can link it to a cell name?

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  9 ปีที่แล้ว

      fName = "Standard - " & format (now,"mmddyyyy")
      the variable Date is today's date, using format function can let you format it however you want, so the name would be Standard - 12082015
      thanks
      Dan

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  9 ปีที่แล้ว

      fName = "Standard - " & format (now,"mmddyyyy")
      the variable Date is today's date, using format function can let you format it however you want, so the name would be Standard - 12082015
      thanks
      Dan

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  9 ปีที่แล้ว

      fName = "Standard - " & format (now,"mmddyyyy")
      the variable Date is today's date, using format function can let you format it however you want, so the name would be Standard - 12082015
      thanks
      Dan

    • @ashishmaheshwari7891
      @ashishmaheshwari7891 9 ปีที่แล้ว

      +ExcelVbaIsFun Thanks a lot :). It worked.

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  9 ปีที่แล้ว

      +Ashish Maheshwari no problem, Ashish. Good work!
      Yours,
      Dan

  • @wasimakram522
    @wasimakram522 9 ปีที่แล้ว

    i need a macro to send email with Attachments from excel as mentioned procedure To address in A column , CC address in B Column ,Subject -text in C Column ,Attachment path in D Column ,Message-text in E column and it should save it on outlook Drafts please do the need full in this regards expecting your best results on this

  • @meithileshramautar3412
    @meithileshramautar3412 9 ปีที่แล้ว +1

    Thank you loads sirji

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  9 ปีที่แล้ว

      +Meithilesh Ramautar So welcome!

  • @iris.west305
    @iris.west305 9 ปีที่แล้ว

    Hello, i have a question. How do i save multiple PDF files of one excel worksheet alone using vba? I tried for loop, but it doesn't seem to work

  • @maggiethinyane
    @maggiethinyane 8 ปีที่แล้ว

    hey there can you please help me. what am i doing wrong with this formula;sumnth = application.WorksheetFunction.SumProduct(--(MOD(COLUMN(.range("A" & LastRo & ":O" & LastRo))-COLUMN(.range("A" & lastRo))+1,2)=0),.range("A" & LastRo & ":O" & LastRo))
    i get the error is "Expected expression"

  • @sudiptaghosh326
    @sudiptaghosh326 7 ปีที่แล้ว

    Every time when Trying to save .xlsm file to .pdf through macro button, the existing file was replacing with new one. how can I prevent it as I want to save files in different name. pls help...

  • @cliftonmcreynolds5612
    @cliftonmcreynolds5612 9 ปีที่แล้ว +2

    Hello Dan - great video, could you expand on making the file name dynamic? Maybe post the code? That would be great. :) Thank you.

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

      Have u fund the way of making it dynamic? :)

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

      @@christianlaursen4582 Has anyone figured this out yet?

  • @CostasPapanikolaou
    @CostasPapanikolaou 8 ปีที่แล้ว +1

    SOLVED FROM ME!!!!
    for everyone who may need this!!!
    Sub export2pdf()
    '
    ' export2pdf Macro
    '
    '
    ThisWorkbook.Sheets(Array("a ian", "b ian", "a feb", "b feb", )).Select
    Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ActiveWorkbook.Path & Application.PathSeparator & "15imera" & Format(Date, "ddmmyyyy")
    End Sub
    ----------------------
    SOLUTION:
    change" Selection.Export..." to "Activesheet.Export..."
    Here is the situation:
    In main .xslb file I have multiple sheets like above. Everything works great except one thing: it exports ONLY the 1st pages of each sheet and not all the pages of each sheet.
    example:
    in sheet "a ian" there is only one page
    in sheet "b ian" there are 3 pages
    etc...
    but it gives me in pdf file only the 1st page of each sheet.
    Any help from you?
    Thank you for your time.

  • @mdanwarfaizi6590
    @mdanwarfaizi6590 7 ปีที่แล้ว +1

    USEFULL

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

    Got a problem when my coworker runs my code similar ( inspired) to this code, we get an 1004 error, what am i doing wrong

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

      Hi liqw3d,
      Can we see the offending code to better assist?
      Thanks
      Dan

  • @PaulDupreonegod007
    @PaulDupreonegod007 9 ปีที่แล้ว

    @ExcelVbaIsFun Is there a way to get a macro to work where it prints an output report for each employee, that is based off of a table of values, to a single PDF file instead of cycling and printing a separate PDF file for each employee. here is the code as it stands. It works well except when I try to print all to PDF and have to individually save 214 PDFs because it wont batch print all records in one PDF.

    PSP Rpts

    STEP()

    =ECHO(FALSE)


    =SET.NAME("CNUM",INPUT("Enter
    number of copies to be printed.",1,"PSP Reports",1,100,100))

    =SELECT(!$C$10)

    =IF(ISBLANK(ACTIVE.CELL()),GOTO(A13))

    =SELECT("R[1]C")

    =GOTO(A10)

    =SET.NAME("NUM",ROW(ACTIVE.CELL())-10)

    =WORKBOOK.SELECT("PSP
    Output","PSP Output")

    =FORMULA.FILL(1,!$T$1)

    =IF(NUM>!$T$1,GOTO(A19))

    =SELECT(!$A$1:$S$42)

    =GOTO(A20)

    =SELECT(!$A$1:$S$42)

    =SET.PRINT.AREA()


    =PRINT(1,1,1,1,FALSE,FALSE,1,FALSE,1)

    =SET.NAME("CNT",!$T$1+1)

    =IF(CNT>NUM,GOTO(A27))

    =FORMULA.FILL(CNT,!$T$1)

    =GOTO(A16)

    =SET.NAME("CNUM",CNUM-1)

    =IF(CNUM>0,GOTO(A15))




    =WORKBOOK.SELECT("INPUT","INPUT")

    =SELECT(!$A$1)

    =RETURN()

  • @Berita--Terkini
    @Berita--Terkini 4 ปีที่แล้ว

    How to save pdf with save dialog.? Please

  • @akashshinde3298
    @akashshinde3298 6 ปีที่แล้ว

    Sir I have use this code in vba. But error display on screen is "Run-time error 15, Invalid procedure call or argument ". Kindly guide me solve this error. And also I have check the code is many times,.

  • @ExcelxlNl
    @ExcelxlNl 9 ปีที่แล้ว

    Thank you

  • @Berita--Terkini
    @Berita--Terkini 4 ปีที่แล้ว

    How to create Excel to word documen

  • @swethankurakula1986
    @swethankurakula1986 8 ปีที่แล้ว

    I am able to create the pdf without protecting it with password but i am looking to save file with pdf and password protected, when i do that i am not able to enable password. Can you show me how to record macro using password enabled macro...??please

  • @bhaveshvala5882
    @bhaveshvala5882 5 ปีที่แล้ว

    an error , show xlTypePDF =0 what to do

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

    My excel file has 1 sheet, including 2 pages. I need you to support vba code to create 2 PDF files, each page is a PDF file, save the resulting file in
    In addition, there are other similar cases such as:
    1/ All sheets
    2/ Select any number of Sheets
    Have a nice day

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

    Can you please put the code here in the comment? :(

  • @meyyammaithiagarajan3656
    @meyyammaithiagarajan3656 7 ปีที่แล้ว

    is it possible to export password protected PDFs

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  7 ปีที่แล้ว

      These folks had some success. You have to install a freeware pdf tool typically but then Excel VBA looks like it can tap into those code libraries. Happy Coding: stackoverflow.com/questions/12373631/vba-to-save-a-sheet-to-a-password-protected-pdf or www.mrexcel.com/forum/excel-questions/593415-password-protected-pdf-file.html
      Thanks
      Dan

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

    0:38 ye AKA kanye

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

      Thanks, my chromebook for helping my pronunciation! :)