+ Reply to Thread
Results 1 to 5 of 5

VBA to save all worksheets as separate .csv files - macOS

  1. #1
    Forum Contributor
    Join Date
    03-30-2020
    Location
    Wales, UK
    MS-Off Ver
    365 (Mac)
    Posts
    191

    VBA to save all worksheets as separate .csv files - macOS

    Hi,

    I have the following code, which saves / exports all worksheets within a single .xlsx file to separate .xlsx files in the same file path location:

    Please Login or Register  to view this content.
    Is there a way that I can amend this to work so that it saves the files in .csv format instead. I have tried a few things (see a related post here: VBA to save all worksheets as separate .xlsx files - macOS), but none have worked so far - despite working for the suggesting user on Windows OS.

    Below is one of the suggestions, but despite working on Windows, it didn't work for my Mac. Guessing there must be a different file type part to make it work, rather than 'xlCSVUTF8'.

    Please Login or Register  to view this content.
    Also posted on MR. EXCEL: https://www.mrexcel.com/board/thread...macos.1237649/

    Thanks in advance!
    Last edited by ollyhughes1982; 05-23-2023 at 03:03 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,266

    Re: VBA to save all worksheets as separate .csv files - macOS

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    03-30-2020
    Location
    Wales, UK
    MS-Off Ver
    365 (Mac)
    Posts
    191

    Re: VBA to save all worksheets as separate .csv files - macOS

    Apologies, I have now done this. Thanks.

  4. #4
    Forum Contributor
    Join Date
    03-30-2020
    Location
    Wales, UK
    MS-Off Ver
    365 (Mac)
    Posts
    191

    Re: VBA to save all worksheets as separate .csv files - macOS

    Whsatever suggested solutions I try it always seems to be an issue with the SaveAs line of code. Is there special format required on mac? I have looked everywhere I can think of and can't find a solution. Any help appreciated!

  5. #5
    Forum Contributor
    Join Date
    03-30-2020
    Location
    Wales, UK
    MS-Off Ver
    365 (Mac)
    Posts
    191

    Re: VBA to save all worksheets as separate .csv files - macOS

    This has now been solved by somebody I found online, Ron de Bruin (https://mvp.microsoft.com/en-us/Publ...n%20de%20bruin & https://macexcel.com). He gave me the following VBA script, which has worked perfectly:

    Please Login or Register  to view this content.
    Highly recommend visiting his site if you have time! He also does Windows solutions, here: http://www.rondebruin.nl

    Thanks, all.

+ 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. Replies: 1
    Last Post: 04-18-2023, 05:06 AM
  2. MacOs - How to close code windows? AND how to reorder the debug bar [MacOS]
    By lord anubis in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 06-05-2022, 02:02 PM
  3. Import Macro to import separate files to separate worksheets - deletes existing worksheets
    By Hondahawkrider in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2015, 02:24 PM
  4. [SOLVED] Save all worksheets in a folder (incl subfolders) as separate files (w/o name conflicts)
    By 1819 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-02-2015, 08:02 PM
  5. [SOLVED] VBA to save multiple worksheets as separate CSV files using name of worksheet
    By Yg74 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2012, 10:55 AM
  6. VBA to save multiple worksheets as separate CSV files using name of worksheet
    By titushanke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2012, 08:08 AM
  7. Save 2 separate data imports in separate worksheets on the same ex
    By Jay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-08-2006, 09:35 AM

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