+ Reply to Thread
Results 1 to 12 of 12

Save the Output in Separate CSV Files

  1. #1
    Registered User
    Join Date
    02-24-2014
    Location
    NOIDA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Question Save the Output in Separate CSV Files

    Hi All,
    I have the below script which produces output in different cells , I want to be able to save separate CSV files of the output generated.Kindly help. (File Attached)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Leith Ross; 10-18-2018 at 06:22 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Save the Output in Separate CSV Files

    Hello aashishni ,

    This macro will create CSV files based on the OS name and the limit for the IP addresses to be saved.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-24-2014
    Location
    NOIDA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Save the Output in Separate CSV Files

    Hi Leith,
    Thanks a lot for your inputs, however I am getting a runtime error when I execute the macro, the error prompt being "RUN TIME ERROR '76'". and on debugging it takes to "Open File For Output As #1" in the code.
    Please suggest.

    I downloaded the file you attached and executed the same.

    Thanks

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Save the Output in Separate CSV Files

    Hi aashishni,

    Have you seen Rule 8 in: https://www.excelforum.com/forum-rul...rum-rules.html
    Please do follow it.
    Best Regards,

    Kaper

  5. #5
    Registered User
    Join Date
    02-24-2014
    Location
    NOIDA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Save the Output in Separate CSV Files

    Hi Kaper,

    thanks for pointing it out..sure will follow it !

    Thanks

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Save the Output in Separate CSV Files

    Hello aashishni ,

    You need to change the variable Path from "C:\Test" to the folder where you want the files to be saved.

  7. #7
    Registered User
    Join Date
    02-24-2014
    Location
    NOIDA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Save the Output in Separate CSV Files

    Hi Leith,

    Ok..I got the error resolved by changing the path name however the output is not correct, it is putting the IP addresses in one row multiple cells whereas we need it in one cell separated by a comma.
    Can you please check that ? And is it possible to get a prompt when the macro has completed the execution?

    Thanks

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Save the Output in Separate CSV Files

    Hello aashishni ,

    Here is the amended macro. Change Path before you run the macro.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-24-2014
    Location
    NOIDA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Save the Output in Separate CSV Files

    It works now !!! Yay !!!
    However, I used a data where I had multiple OS mentioned and then the CSV file for AIX did not populate correctly, had incorrect values (IP address) and multiple 00,00,00 entries.
    Any suggestions ?
    Apologies if I am bugging you too much but this is really helpful for me :-)
    Attached Files Attached Files

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Save the Output in Separate CSV Files

    Hello aashishni,

    Here is the updated macro and workbook. The macro let's you select the destination folder. I change it back it want.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-24-2014
    Location
    NOIDA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Save the Output in Separate CSV Files

    WOW !!!! That works wonderfully ! I owe you a lot !
    Resolving the thread , will reach out to the forum again in case of any help required !

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Save the Output in Separate CSV Files

    Hello aashishni,

    Another satisfied customer! Glad I could help.

+ 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. How to browse the path for the input files and save the output using a userform
    By priyankaseshadri in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2014, 03:14 PM
  2. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. [SOLVED] How do I save sheets in a workbook to separate files?
    By Omzala in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2005, 03:06 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