Save Excel Sheet as PDF with Simple Macro - ExcelVbaIsFun

Поділитися
Вставка
  • Опубліковано 10 лип 2024
  • 📊 Free Workbooks: www.excelvbaisfun.com/links?u...
    🥷Join Excel Ninja Pro: www.excelvbaisfun.com/ninjapr... Months FREE On Annual Plan Auto Applied)
    🥷Excel Ninjas FB Group: www.excelvbaisfun.com/xlninjas (Free downloads, Trainings, Live Q&A and more)
    Save Excel Sheet as PDF with Simple Macro - ExcelVbaIsFun
    Fantastic Developer Tools:
    🔒 Transform Any Excel File Into A Locked EXE: www.excelvbaisfun.com/secure-... (25% off with code ‘25OFF’)
    🟡 Create Custom Installers: www.excelvbaisfun.com/custom-...
    👋 Business Inquiries, Consulting, Comments, etc: www.excelvbaisfun.com/contact/

КОМЕНТАРІ • 70

  • @excelisfun
    @excelisfun 9 років тому

    Thanks for the video!!

  • @pulse_sonic
    @pulse_sonic 6 років тому +1

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

  • @yiwenfoong304
    @yiwenfoong304 8 років тому

    Thank you so much! Works perfect

  • @Pankaj-Verma-
    @Pankaj-Verma- 4 роки тому

    Thank you so much for your kind help!

  • @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.

  • @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

  • @taylorbattistella7610
    @taylorbattistella7610 8 років тому

    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!

  • @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!!

  • @marymadyarova5917
    @marymadyarova5917 5 років тому

    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.

  • @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!

  • @sinanbasha-2564
    @sinanbasha-2564 5 років тому

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

  • @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

  • @SonyShine456
    @SonyShine456 8 років тому

    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

  • @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...

  • @pieterlwd
    @pieterlwd 5 років тому +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?

  • @rbrtktl
    @rbrtktl 3 роки тому

    Perfect tutorial, thanks.

  • @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

  • @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

  • @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

  • @mdanwarfaizi6590
    @mdanwarfaizi6590 7 років тому +1

    USEFULL

  • @meithileshramautar3412
    @meithileshramautar3412 8 років тому +1

    Thank you loads sirji

  • @ExcelxlNl
    @ExcelxlNl 9 років тому

    Thank you

  • @genevievewilson9271
    @genevievewilson9271 4 роки тому

    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  4 роки тому

      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

  • @krn14242
    @krn14242 9 років тому

    Thanks Dan.

  • @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"

  • @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,.

  • @JonMichael1087
    @JonMichael1087 5 років тому

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

  • @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

  • @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.

  • @lucianomartinez5107
    @lucianomartinez5107 5 років тому

    got a question, i can print several documents through a sort of loop from a data validation list which is great. but i want to have the ability to saveaspdf as well. let me show you my code i have for printing through an iteration. maybe you can help me do the same for saveaspdf through a sort of iteration of some kind:
    Sub Iterate_Through_data_Validation()
    Dim xRg As Range
    Dim xCell As Range
    Dim xRgVList As Range
    Set xRg = ActiveSheet.Range("D1")
    Set xRgVList = Evaluate(xRg.Validation.Formula1)
    For Each xCell In xRgVList
    xRg = xCell.Value
    ActiveSheet.PrintOut
    Next
    End Sub

  • @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 3 роки тому

      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?

  • @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

  • @bhaveshvala5882
    @bhaveshvala5882 4 роки тому

    an error , show xlTypePDF =0 what to do

  • @ashishmaheshwari7891
    @ashishmaheshwari7891 8 років тому +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  8 років тому

      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  8 років тому

      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  8 років тому

      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 8 років тому

      +ExcelVbaIsFun Thanks a lot :). It worked.

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  8 років тому

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

  • @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

  • @Berita--Terkini
    @Berita--Terkini 4 роки тому

    How to save pdf with save dialog.? Please

  • @Berita--Terkini
    @Berita--Terkini 4 роки тому

    How to create Excel to word documen

  • @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()

  • @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 3 роки тому

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

    • @surferol10
      @surferol10 3 роки тому

      @@christianlaursen4582 Has anyone figured this out yet?

  • @riccardosimonetti4073
    @riccardosimonetti4073 Рік тому

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

  • @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

  • @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.

  • @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! :)