+ Reply to Thread
Results 1 to 6 of 6

Formula that does text to rows

  1. #1
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Formula that does text to rows

    I have attached what the data looks like and what I want the outcome to be. I want to dump the data in excel as is and have it make the changes. The fields in columns E-J will have a specific data set such as a dollar amount or an invoice number, etc., but as you can see the data pulls in two amounts in cell G4 separated by a dash. This is because there should technically be two lines of data instead of one but when I export it pulls it in this way. So A-D I want the data to get copied down based on how many amounts there are and E-J will apply one of the pieces of data to each line. If there is two amounts then there is two lines if there is three then three lines and so on. You may also notice after the last item in each of the cells in E-J a single letter exists this letter means nothing and will be removed. The reason this is this way is because the web form I download out of has a matrix where I add GL, Amount, Invoice#, Tracking#, and FY and if I have to add another invoice with seperate amounts or a different GL I click on a button that allows me add a second row in the web form and then I plug in the numbers. Once I am done I click download and it takes the data in that form and essentially creates a Journal entry or atleast that is what I would like to happen. Down the road I will be pulling downloads like the one I attached but they will be much more data intensive like 20-100 rows of data and not 2 rows
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Formula that does text to rows

    I don't know of a formula to do this but it can be done with a macro. Are you open to macros?
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: Formula that does text to rows

    I haven't had much experience with macros but im open to give it a shot it's always a good time to learn something new.

  4. #4
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: Formula that does text to rows

    so here is what I found so far

    Sub SplitAndTranspose()
    Dim N() As String
    N = Split(ActiveCell, " - ")
    ActiveCell.Resize(UBound(N) + 1) = WorksheetFunction.Transpose(N)
    End Sub

    This works great for an individual cell that has separation by a Hyphen(-) but I need to apply it to any cells in columns E-J not just one cell, and I also need to make sure that it doesn't
    overwrite the rows below it. I think my goal is to be able to dump a data set in to a spreadsheet where there is data in the range A1:J50 and then run the macro by and have it do the conversion throughout
    the entire data set A-J. On a side note the data in columns A-D would not be seperated they would just be copied down to the next cells. I have reattached a sample data set.
    Attached Files Attached Files

  5. #5
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Formula that does text to rows

    Here is a macro that should work for you.
    It is not a sophisticated one. More like brute force but it works.
    And it is easier for you to understand the process.
    See attached workbook for a working example.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: Formula that does text to rows

    Thank you this worked perfectly.

+ 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. Replies: 3
    Last Post: 08-06-2014, 07:57 AM
  2. How to delete rows that contain certain text in a cell using a formula
    By panchovilla1221 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2014, 09:00 PM
  3. Formula help - auto removing text in rows
    By Adampams in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-17-2013, 09:37 AM
  4. Need Formula for Delimited text to Rows- Is it possible?
    By adavid02 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2013, 10:52 AM
  5. [SOLVED] TEXT Formula to identify rows of cells with Matching TEXT *** Actual Worksheet attached.
    By steve08087 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-29-2013, 12:42 PM
  6. [SOLVED] Need a formula for identifying text in rows of cells
    By steve08087 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-29-2013, 01:45 AM
  7. [SOLVED] Formula to add or delete rows if no text
    By slohman in forum Excel General
    Replies: 4
    Last Post: 03-31-2012, 07:42 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