+ Reply to Thread
Results 1 to 6 of 6

Search through columns and find specific text and replace that text with header column

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    Sydney
    MS-Off Ver
    Excel 365 Pro
    Posts
    6

    Search through columns and find specific text and replace that text with header column

    I need help with a macro that searches through columns of a table and picks up the letter x and replaces the letter x with the header of that particular column.
    Once the letter x has been replaced with the header, the structure of the data changes from a table to list the items that have changed from x to the headers downwards.

    I have attached an example file.

    Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,684

    Re: Search through columns and find specific text and replace that text with header column

    Run this code from the output sheet

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Please Login or Register  to view this content.
    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Search through columns and find specific text and replace that text with header column

    with the help of this macro you can arrange your data excel file attached.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search through columns and find specific text and replace that text with header column

    Another:

    Please Login or Register  to view this content.
    PS: Created a Sheets Output to memic the results sheet.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Search through columns and find specific text and replace that text with header column

    Here's another...

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-09-2014
    Location
    Sydney
    MS-Off Ver
    Excel 365 Pro
    Posts
    6

    Re: Search through columns and find specific text and replace that text with header column

    Thanks for everyone's help! Perfect

+ 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. Search rows to find specific text and move to a different column ?
    By Udaipur99 in forum Excel - New Users/Basics
    Replies: 19
    Last Post: 03-19-2014, 01:11 PM
  2. Macro to find header information and replace with specific text
    By Nancy Taylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2013, 04:47 PM
  3. [SOLVED] VBA to Search a Text String, Find a Value listed in another column and replace the text
    By Jschrod303 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 08:56 PM
  4. Need a Macro 2 search rows for text and replace with column header...
    By XcelRookie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2012, 05:48 PM
  5. macro to replace specific data with column header text
    By wkilc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2010, 11:52 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