Results 1 to 2 of 2

Write to multiple text files from multiple Excel worksheets based on some conditions

Threaded View

  1. #1
    Registered User
    Join Date
    08-14-2009
    Location
    DXB
    MS-Off Ver
    Excel 2007
    Posts
    3

    Write to multiple text files from multiple Excel worksheets based on some conditions

    Dear Experts,


    Salesman Territory Sub Territory Total
    Harry North Sector1 150
    Harry South Sector1 246
    Evellyn North Sector1 433
    Evellyn North Sector2 767
    Evellyn East Sector1 1345
    Jerry East Sector2 3428
    Jerry East Sector3 456
    Jerry East Sector4 256
    Jerry West Sector3 789
    Jerry West Sector2 488


    I have a worksheet with data such that the column A will have data with the names of salesmen, Column B the territories he is assigned, Column C the sub territories and Column the sales and so forth. I have a macro which will split the data into different worksheets with the salesmen’s name as the worksheet name i.e. I will have worksheet with names Harry, Evellyn, Jerry with each containing the data of the respective salesmen only.

    Now I would like to have a macro that will run only on all the newly created worksheets (Harry, Evellyn and Jerry) and not on the main worksheet that will write the data into different text files, i.e. the data of Data of Harry worksheet into Harry.TXT, Data of Evellyn worksheet into evellyn.txt etc…in the following format:

    **************Jerry Record*************

    “Following are the details of Jerry”

    Territory: East

    SubTerritory: Sector1, Total :3428
    SubTerritory: Sector2, Total :456
    SubTerritory: Sector3, Total :256

    Total for Territory East for Jerry : 4140

    Territory:West

    SubTerritory: Sector1, Total :789
    SubTerritory: Sector2, Total :488

    Total for Territory West for Jerry : 1277

    Total for Territory : 5417

    **************Jerry Record*************
    Last edited by E-tech; 12-05-2010 at 05:02 AM.

Thread Information

Users Browsing this Thread

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

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