Results 1 to 3 of 3

Thread: Macro to export sheet as CSV

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Posts
    193
    Rep Power
    13

    Macro to export sheet as CSV

    I have a sheet on a workbook called "Upload"

    I would like to set up a macro to export this sheet as a CSV file to a directory called "temp" and to save the exported sheet as "Journal Upload". I have values in Col A:F and the maximum number of rows that will be used is 500

    Your assistance in this regard will be most appreciated

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Try

    Code:
    Sub kTest()
        
        Dim Sht     As Worksheet
        
        Set Sht = Worksheets("Upload")
        
        Sht.Copy
        ActiveWorkbook.SaveAs "C:\Temp\Journal Upload.CSV", 6
        ActiveWorkbook.Close 0
        
    End Sub
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Posts
    193
    Rep Power
    13
    Thanks for the help, much appreciated

Similar Threads

  1. Macro To Close All CSV Files
    By Howardc in forum Excel Help
    Replies: 5
    Last Post: 03-15-2014, 05:24 PM
  2. Replies: 1
    Last Post: 01-27-2013, 08:21 PM
  3. Xls export to txt
    By marreco in forum Excel Help
    Replies: 4
    Last Post: 12-28-2012, 10:43 PM
  4. export all worksheets to separate csv files
    By rabidfly in forum Excel Help
    Replies: 4
    Last Post: 11-18-2012, 02:11 PM
  5. Collate Data from csv files to excel sheet
    By dhiraj.ch185 in forum Excel Help
    Replies: 16
    Last Post: 03-06-2012, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •