+ Reply to Thread
Results 1 to 10 of 10

[VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

  1. #1
    Registered User
    Join Date
    03-24-2013
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2010/2013
    Posts
    83

    [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Hi friends!


    This problem is related to my old post that was solved already: http://www.excelforum.com/excel-prog...ml#post3788991

    Now, my problem is that how can I overwrite the data that was exported in multiple semi-colon delimited files?
    What I want to happen is that it won't add any data but it'll overwrite the old data with the new data that'll be exported. May I know how I can do this?

    This is the code that I still use (given by Tinbendr),

    Please Login or Register  to view this content.

    How can I modify this?

    Your help is highly appreciated.
    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Hi,

    For all of the csv files replace respective code like this:

    Please Login or Register  to view this content.
    with this

    Please Login or Register  to view this content.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    03-24-2013
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2010/2013
    Posts
    83

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Quote Originally Posted by buran View Post
    Hi,

    For all of the csv files replace respective code like this:

    Please Login or Register  to view this content.
    with this

    Please Login or Register  to view this content.
    woah! that's fast.
    will try it now.
    Thanks!

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Sorry, but as was quick to answer and I was wrong. My preveous suggestion would end up with csv file with only one row.

    Here is your code amended accordingly

    Please Login or Register  to view this content.
    Note that it's not tested as I was not able to download sample file from preveous thraed
    Last edited by buran; 09-10-2014 at 03:49 AM. Reason: slight change in code

  5. #5
    Registered User
    Join Date
    03-24-2013
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2010/2013
    Posts
    83

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Quote Originally Posted by buran View Post
    Sorry, but as was quick to answer and I was wrong. My preveous suggestion would end up with csv file with only one row.

    Here is your code amended accordingly

    Please Login or Register  to view this content.
    Note that it's not tested as I was not able to download sample file from preveous thraed
    woah! that's nice and so fast!
    but I have a little problem .. (see attached files):

    in photo 1, that is the sample data
    in photo 2, that is the sample of the exported file of property type = CD (condo.csv)
    in photo 3, that is the sample of the exported file of property type = LA (land.csv)

    The problem is that in condo csv file it has the header ie. SUBCATEGORIES DUMMY, categories, offer_type, sku_supplier_source, sku_supplier_config, available_from, etc ... while the land csv file doesn't have.


    I attached also the excel file.
    Thanks so much!
    Attached Images Attached Images
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    It's because you have this line

    Please Login or Register  to view this content.
    i.e. it writes header only to condo.csv and it was also like this in your original code. Am I right that you want header in all files?

  7. #7
    Registered User
    Join Date
    03-24-2013
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2010/2013
    Posts
    83

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Quote Originally Posted by buran View Post
    It's because you have this line

    Please Login or Register  to view this content.
    I see that's also my problem but then I don't know how to modify it further.

    i.e. it writes header only to condo.csv and it was also like this in your original code. Am I right that you want header in all files?
    Yes, I do want the headers in all files, Buran.
    Thank you so much!

  8. #8
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Here is the code. I rearranged it a bit:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    03-24-2013
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2010/2013
    Posts
    83

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    Quote Originally Posted by buran View Post
    Here is the code. I rearranged it a bit:

    Please Login or Register  to view this content.
    wow! that's so fast. thank you so much! my problem is now solved.
    Thanks for your time helping me with my excel.

  10. #10
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: [VBA] Overwrite the semi-colon delimited csv files when exporting the multiple sheets

    great! don't forget to mark thread as [SOLVED]

+ 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. [SOLVED] Semi-colon Delimited String Contains Text Occuring in Column
    By The831st in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2014, 06:28 AM
  2. [SOLVED] Saving/Exporting Multiple Sheets as Multiple Semi-Colon Delimited CSV Files VBA
    By dylanrose in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-01-2014, 08:32 AM
  3. VBA Code to Save Excel File As Semi-Colon Delimited Format
    By mab1284 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2014, 09:52 AM
  4. Replies: 2
    Last Post: 07-01-2013, 12:28 PM
  5. [SOLVED] How do I export Excel in a semi-colon delimited format?
    By Robert1105 in forum Excel General
    Replies: 4
    Last Post: 05-28-2005, 05:05 PM

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