Results 1 to 9 of 9

Export multiple (specific) worksheets to CSV files in a specified directory

Threaded View

reghyh Export multiple (specific)... 08-20-2015, 09:40 PM
JBeaucaire Re: Export multiple... 08-20-2015, 11:54 PM
reghyh Re: Export multiple... 08-21-2015, 02:28 AM
JBeaucaire Re: Export multiple... 08-21-2015, 04:14 AM
reghyh Re: Export multiple... 08-21-2015, 01:50 PM
JBeaucaire Re: Export multiple... 08-21-2015, 08:35 PM
reghyh Re: Export multiple... 08-21-2015, 08:47 PM
JBeaucaire Re: Export multiple... 08-21-2015, 09:03 PM
humdingaling Re: Export multiple... 08-25-2015, 02:43 AM
  1. #1
    Registered User
    Join Date
    08-20-2015
    Location
    America
    MS-Off Ver
    2016
    Posts
    4

    Export multiple (specific) worksheets to CSV files in a specified directory

    I'm new to VBA. I'm trying to do the following but the code isn't quite working as expected -

    1. Export/Copy particular sheets in the workbook (any sheet name that contains "Upload") to a particular file directory.

    2. I don't want these worksheet names to change nor the workbook name to change.

    3. The file-name is consistent for each worksheet, so it would be okay to replace the files in the directory whenever I run the macro. Its okay to have a dialog box that asks if I'm sure I want to replace each of the files.

    4. I don't want the newly created CSVs or any other file to open.
    --

    Sub COPYSelectedSheetsToCSV()
    '
    '
    Sheets("Moo Upload").Select
    Sheets("Moo Upload").Name = "Moo Upload"
    ActiveWorkbook.SaveAs Filename:="/Users/reginaho/Desktop/Upload/Moo Upload.csv", _
        FileFormat:=xlCSV, CreateBackup:=False
    Sheets("Dodo Upload").Select
    ActiveWorkbook.SaveAs Filename:="/Users/reginaho/Desktop/Upload/Dodo Upload.csv", _
        FileFormat:=xlCSV, CreateBackup:=False
    Sheets("Lulu Upload").Select
    ActiveWorkbook.SaveAs Filename:="/Users/reginaho/Desktop/Upload/Lulu Upload.csv", _
        FileFormat:=xlCSV, CreateBackup:=False
    Sheets("Ahhh Upload").Select
    ActiveWorkbook.SaveAs Filename:="/Users/reginaho/Desktop/Upload/Ahhh Upload.csv", _
        FileFormat:=xlCSV, CreateBackup:=False
    End Sub
    Last edited by JBeaucaire; 08-20-2015 at 11:54 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Importing specific data from multiple text files in a file directory into excel
    By abat in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-03-2013, 05:26 PM
  2. [SOLVED] Macro to Import Multiple TXT Files into workbook - User to select files/directory
    By saber007 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-15-2013, 08:43 PM
  3. [SOLVED] Copy specific files from one directory to another
    By brazil in forum Excel General
    Replies: 2
    Last Post: 03-06-2013, 03:56 PM
  4. Replies: 1
    Last Post: 10-30-2012, 06:34 PM
  5. Save worksheets as csv files in a given directory
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2011, 03:22 AM
  6. Opening files in specific directory
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2009, 12:34 AM
  7. Copy selected files into a specific directory
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2009, 10:50 AM
  8. [SOLVED] Opening all files located in a specific directory
    By DaSo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2005, 04:06 AM

Tags for this Thread

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