+ Reply to Thread
Results 1 to 4 of 4

Create two files depending on data

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    49

    Create two files depending on data

    Hi,

    I have an excel spreadsheet that I would like to create two different dat files from depending on what is in the Reversal column. Also before outputting to the dat file I would like it to resize the columns.

    Here is what the spreadsheet currently looks like:

    | student ID | Amount | Fund ID | Descr | Transaction Date | Term | Reversal |
    | 1234567 | 866.00 | 9530 | FA16 | 20160531 | 5510 | Y |
    | 1234567 | 866.00 | 9530 | FA16 | 20160531 | 5602 | Y |
    | 1234567 | 1256.5 | 9330 | FA16 | 20160531 | 5602 | Y |
    | 1234567 | 615.5 | 9330 | FA16 | 20160531 | 5602 | N |
    | 1122333 | 1366 | 9630 | FA16 | 20160531 | 5510 | Y |
    | 1122333 | 826 | 9630 | FA16 | 20160531 | 5510 | N |
    | 1122333 | 1366 | 9630 | FA16 | 20160531 | 5602 | Y |

    After the split to two DAT files (and deleting the header row):

    DisbNeg.dat would have this in the file:

    | 1234567 | 866.00 | 9530 | FA16 | 20160531 | 5510 | Y |
    | 1234567 | 866.00 | 9530 | FA16 | 20160531 | 5602 | Y |
    | 1234567 | 1256.5 | 9330 | FA16 | 20160531 | 5602 | Y |
    | 1122333 | 1366 | 9630 | FA16 | 20160531 | 5510 | Y |
    | 1122333 | 1366 | 9630 | FA16 | 20160531 | 5602 | Y |

    DisbPos.dat would have this in the file:

    | 1234567 | 615.5 | 9330 | FA16 | 20160531 | 5602 | N |
    | 1122333 | 826 | 9630 | FA16 | 20160531 | 5510 | N |

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create two files depending on data

    This spits the file into two text files based on column G.
    Please Login or Register  to view this content.
    You're request to resize a column is irrelevant since you can't save formatting information with a text file.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: Create two files depending on data

    This is great! Thanks! Is there a way to split onto separate worksheets within the same workbook? If I can get them on separate worksheets I can figure out setting the column widths.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create two files depending on data

    Since the method for working with sheets is different than text files, I suggest you start a new thread.

+ 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] Macro to add rows depending on the size of data volume and create new workbook
    By bimmy80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-16-2015, 11:05 AM
  2. Replies: 2
    Last Post: 08-18-2014, 08:39 PM
  3. [SOLVED] Create List depending on data in Drop Down
    By Raanan in forum Excel General
    Replies: 6
    Last Post: 08-13-2013, 07:59 AM
  4. [SOLVED] Need to Save current sheet to one of two files depending on data ( Q or I)
    By carlandtina02 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-01-2013, 03:50 AM
  5. Replies: 7
    Last Post: 08-10-2012, 09:43 AM
  6. Replies: 3
    Last Post: 04-12-2012, 09:07 AM
  7. [SOLVED] Data validation: How to create different drop down lists depending on user's response?
    By WillGe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2012, 04:39 AM

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