+ Reply to Thread
Results 1 to 5 of 5

Text Extraction using headers as reference

  1. #1
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    Text Extraction using headers as reference

    Is there a way to extract the information out of each field that will be listed as headers as reference for the macro?

    Please have a look,

    3 worksheets.
    1) "Raw data"
    2) "Output" - reformatting of the raw data
    3) "Example" - expected result

    Text Extractor.xlsm

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Text Extraction using headers as reference

    Tr this:-
    Results on sheet "Output" starts "B3".
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Text Extraction using headers as reference

    Hi,

    For a non macro way see attached

    I replicated your Raw Data so that I didn't destroy the original data and used this replica sheet for the task. You will of course use your original.

    1. Enter the formula you see in B1 and copy this down
    2. Copy column B and paste it back as values to B1 so that you now have values rather than the formulae.
    3. Use Text to Columns on column B specifying the '|' pipe and space characters as delimiters so that you get the result you see in B4:I9
    4. Your Output sheet contains the formulae you see in B3:E3 copied down.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Text Extraction using headers as reference

    Please Login or Register  to view this content.
    May I know why the need to expand the array size by 4 times?
    Please Login or Register  to view this content.
    also, how does this (1) work? does it mean (0) = first element / (1) = second element / (2) = third element
    Please Login or Register  to view this content.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Text Extraction using headers as reference

    Ref:- "Rng.count *4. Actually you don't need (rng.count *4), Rng.count would have done , I was thinking each row in a used cell would have 4 lines, but it actually has just one line.
    The general purpose was to have an array large enough to cover all the used data. When you place the filled array in the "OutPut" sheet you only show the amount of the array thats used .i.e variable "c".
    Ref:- Split array. When you create a array using the "Split" function, it is a zero based array, so the first element of array "Sp" will be Sp(0)
    Hope that helps.
    Regrds Mick

+ 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] Text Extraction
    By pax_07 in forum Excel General
    Replies: 3
    Last Post: 07-31-2014, 01:44 PM
  2. Data extraction using a a cell reference
    By Noushad Vaidyar in forum Excel General
    Replies: 3
    Last Post: 10-28-2013, 09:22 AM
  3. using vba to reference column headers
    By byronova in forum Excel General
    Replies: 2
    Last Post: 03-08-2010, 08:00 AM
  4. Headers based an cell reference
    By JoshuaSQ in forum Excel General
    Replies: 1
    Last Post: 05-08-2007, 12:05 PM
  5. How do I reference Cell information in my Headers?
    By P Alicea in forum Excel General
    Replies: 2
    Last Post: 10-27-2005, 04:05 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