+ Reply to Thread
Results 1 to 8 of 8

Formula to take a column to row, delimited by certain text string

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Formula to take a column to row, delimited by certain text string

    Sorry for the confusing title. I Have a column of text that looks like this:

    Riley Construction
    123 main st.
    everytown, ca
    [email protected]
    734 923 9482
    industry type: 3

    West Town Towing
    19587 main st
    othertown, wa
    industry type: 6

    coast to coast
    8393 main st
    unit 93902
    everytown, ca
    industry type: 9

    My problem is some of the companies entries consist of 3 rows or up to 5 but the last row always starts with "industry type:". I was hoping to take each company entry and turn it into a row. Is that possible? I use to use this formula to do something similar but that was when each company always would be 6 rows: =OFFSET($A$1,0,(COLUMN(A1)-1)+((ROW(A1)-1)*6))

    Is there anyway to have it start a new row after each of the industry type? Thanks and sorry for the confusion.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Formula to take a column to row, delimited by certain text string

    Here's a quick VBA solution

    Please Login or Register  to view this content.
    It runs down the list to the end and puts each row into a new column, stepping to a new line on each "industry type: "
    Run it then just do a replace "industry type: " with null (sorry I couldnt be blowed to program for that)
    Last edited by Special-K; 01-19-2015 at 11:48 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Formula to take a column to row, delimited by certain text string

    Awesome thank you. I can take care of the find and replace. So I feel embarrassed asking a bit but how do I run this VBA? It has been quiet sometime since I have ran one last.

    When I try to insert a new module and run the VBA it gives me a error that says: Run time error '9': subscript out of range and when I hit the debug option it highlights the "LastRow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row" line.
    Last edited by LightingPop; 01-19-2015 at 11:54 AM.

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula to take a column to row, delimited by certain text string

    VBA would work best I reckon, though I put together some formulas to get what you want..

    Note the formula in Col C are different than those in D:K
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Formula to take a column to row, delimited by certain text string

    Hi Ace_XL thanks for the formula but unfortunately it doesn't seem to do the job. I might not be following it right but it seems to take very X row and start a new row but some of the entries have 4 rows and others have up to 8 but the last cell of every entry starts with the text string "Organization Type:"

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula to take a column to row, delimited by certain text string

    Hi Ace_XL thanks for the formula but unfortunately it doesn't seem to do the job. I might not be following it right but it seems to take very X row and start a new row but some of the entries have 4 rows and others have up to 8 but the last cell of every entry starts with the text string "Organization Type:"
    That is factored in.. if you see the attachment in my earlier post, it details out each company details in a separate row.

    if you need just the company names listed, see the attached

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Formula to take a column to row, delimited by certain text string

    Thanks for the help but unfortunately the original formula doesn't seem to work. I have downloaded the sheet you attached and copied over the formula but on the 5 company entry something goes wrong and it throws off all the rest. Not sure why because the 5th entry and all of the rest of them end with the "Organization Type:" cell.

  8. #8
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Formula to take a column to row, delimited by certain text string

    Quote Originally Posted by Special-K View Post
    Here's a quick VBA solution

    Please Login or Register  to view this content.
    It runs down the list to the end and puts each row into a new column, stepping to a new line on each "industry type: "
    Run it then just do a replace "industry type: " with null (sorry I couldnt be blowed to program for that)
    Hi Special-K, I figured out what I was doing wrong the other week with your VBA but it just seems to transpose the row to a line. Like after the VBA is ran all the data which use to be in something like 3,000 cells all in one column are now all in one row. Any help in what I might be missing?

+ 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] Text to column using Delimited
    By Karnik in forum Excel General
    Replies: 3
    Last Post: 11-05-2012, 10:47 PM
  3. Replies: 21
    Last Post: 08-13-2012, 01:52 PM
  4. Importing Delimited Text/Exporting Delimited Text Loop
    By cecarter74 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2009, 01:17 PM
  5. Replies: 5
    Last Post: 02-10-2006, 06:35 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