Excel Macro to export worksheets to new Excel files

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • In this tutorial, we are going to write a macro using VBA, to export multiple worksheets from an Excel file (let's call it the master Excel data file) to a new Excel file.
    Source code:
    learndataanalysis.org/how-to-...
    ► Buy Me a Coffee? Your support is much appreciated!
    -------------------------------------------------------------------------------------------
    ☕ Paypal: www.paypal.me/jiejenn/5
    ☕ Venmo: @Jie-Jenn
    💸 Join Robinhood with my link and we'll both get a free stock: join.robinhood.com/jiej6
    ► Support my channel so I can continue making free contents
    ---------------------------------------------------------------------------------------------------------------
    🌳 Becoming a Patreon supporter: / jiejenn
    🛒 By shopping on Amazon → amzn.to/2JkGeMD
    🗓 Get updated on new Python videos → / madeinpython
    📘 More tutorial videos on my website → LearnDataAnalysis.org
    📺 Also check out my 2nd channel Excel channel focus on sharing Excel tips: bit.ly/3B1DjSA
    ✉ Business Inquiring: UA-cam@LearnDataAnalysis.org
    #Excel #ExcelVBA #VBA

КОМЕНТАРІ • 29

  • @AdrienRaksi
    @AdrienRaksi 9 місяців тому +1

    Hello Jie, excellent tutorial. How can export each tab into a separate worksheet?

  • @darrelantony1
    @darrelantony1 3 роки тому +2

    Hi jie, Thanks so much for this quite helpful. However, how do I ensure that only the values and the formatting of the cells is kept when copied to the new sheet instead of copying the formulas as well? Much appreciated.

  • @Yuloo883
    @Yuloo883 2 роки тому

    Hi, thank you. Is it possible to paste only filtered values?

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

    Hello, I was wondering how I could export specific columns from a worksheet instead of the entire worksheet. They would be the same columns every time. Also, I would like to give the user the option of choosing which worksheets they want data from. Please let me know! Thanks!

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

    Thank u very much....its very informative.
    Can I execute the macro if any defined sheet is missing..?
    Example AAPL is defined in the macro to export but it is missing in the workbook..
    Thank you...

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

    Hi Jie,
    Thanks for the video. It is very useful.

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

      Hi Jie, the is creating,but it is not saving in a specific folder. And to save as the newly created file with macro embedded format. Can you please guide me

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

    Hi Jie, thanks for the code and this is really helpful. My question is how to export the worksheets without formulas but keeping the format? Thanks in advance.

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

    How to make a save path with Str name?

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

    Hi Jie , the new worksheets was created automatically with the random name "Book1", can you please help me if i want to create this worksheet with a chosen by me ? I'll appreciate. thanks

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

    Hi Jie,
    I need a code for all the sheet in a specific file, what you have mentioned in the video is for only 3 sheets, instead i want all the sheets should move to a main file. Can you please create a video for move/copy and then create a copy to the destination file. So that all the sheets from one specific file transferred to the main file.
    Thank you in advance

  • @KrishnaKumar-hw5qp
    @KrishnaKumar-hw5qp 2 роки тому

    Can someone tell me where the exports are saved ?

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

    Hello Jie Jenn, do you have a code that combines your "Excel Macro to export worksheets to new Excel files" & "How To Split An Excel File Into Multiple Files Using VBA (Formula Retained) | Excel Automation"? Thanks!

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

    Hi, Jie. Do you have any additional line of codes for auto-renaming? It's like this- I want to export a sheet to another workbook and auto-rename it like May 1 then May 2 and so on. Thanks for your help.

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

      You need to define your naming pattern first. Once you define the file naming pattern then writing the code for file naming will be an ease.

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

    Hi Jie, Thanks so much for the tutorial, I want to ask if the excel sheets are hidden, what command need to add in VB excel macros ? because if using these command when the sheets are hidden the export file shows nothing.

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

      You need to unhide the sheets first.

  • @flordi8235
    @flordi8235 3 роки тому +1

    Hi Jie great macro ! However why create sheet1 in the final? Should create only 3 worksheets ! Can you help me how to create only the 3 one?

    • @jiejenn
      @jiejenn  3 роки тому +1

      Can you be more specific. Not sure if I fully understand your question.

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

      @@jiejenn @Jie Jenn Sorry, I mean, the new exported file should be GOOGL:TSLA:AAPL , but has one more worksheet named sheet1!So I don't want this wooksheet to be created.I want only 3 !Btw , if i have all my worksheets protected i noticed that with new exported file,they lose all protections!Can you please help me?

    • @ociekhan317
      @ociekhan317 10 місяців тому

      @@jiejenn Hello, I think I understand his question. So, this created the sheets I specified. e.g Dog;Cat;Monkey.... it also created an additional sheet (Sheet1). It did the same in your video.

  • @caribeefoong8535
    @caribeefoong8535 2 роки тому

    Hi Jie. Firstly, thanks for the code. However, how to export two worksheets (eg sheet 1 and sheet 2) to all existing workbook siting in a folder.

    • @jiejenn
      @jiejenn  2 роки тому

      You can insert a loop to iterate worksheets in an Excel file, then use an if statement to check if that's the worksheet you want to export.

    • @caribeefoong8535
      @caribeefoong8535 2 роки тому

      @@jiejenn ok noted with thanks

  • @LetsBland9411
    @LetsBland9411 2 роки тому

    Can you use this to embed the all Excel app even the firm created with bva

    • @jiejenn
      @jiejenn  2 роки тому

      Not sure if I understand your question.

    • @LetsBland9411
      @LetsBland9411 2 роки тому

      @@jiejenn I mean is there a way you can embed Excel project with vba form to a website if it's possible please help

  • @BWL388
    @BWL388 3 роки тому +1

    I'm getting Compile Error: Variable not defined. I have checked every single character against the video. The only thing that is different is the name of the sheet that I am trying to export. Any advise?

    • @BWL388
      @BWL388 3 роки тому +2

      Nevermind. I'm an idiot. I mistook one letter for another. Video is very helpful.