+ Reply to Thread
Results 1 to 5 of 5

Find cell with specific text in a row, then rearrange the columns

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Question Find cell with specific text in a row, then rearrange the columns

    I would like to search cell with contains of specific text "amount" in the different columns in a row from Sheet1. There might be more than one column with "amount". Once the cells with "amount" found, I need to rearrange the cell in another worksheet(Sheet2) with first display the cell with "amount"(1st found amount), "amount"(2nd found) and subsequent "amount" found. After that, will need to display the rest of the cells in the same row.

    sorry that I cant describe my problem very well. appreciate you can refer to the my attachment and advice accordingly. Thank you very much for helping
    Last edited by cyin; 04-18-2012 at 10:58 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Find cell with specific text in a row, then rearrange the columns

    Try this macro

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007.




    Select the rows that you want to process before running it.

  3. #3
    Registered User
    Join Date
    03-31-2012
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Find cell with specific text in a row, then rearrange the columns

    Thanks mrice for your prompt response. It was so helpful and it work greats.
    May I know if it possible to have the macro apply for the whole worksheet instead of doing it row by row?

    Many thanks for your helping. Thanks again and wish you have a good day!

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Find cell with specific text in a row, then rearrange the columns

    The code will work if you select multiple rows. If there are no blank rows in your dataset, then selecting any non-blank cell and hitting CNTRL-SHIFT-8 will select all the relevant cells - then run the macro.

  5. #5
    Registered User
    Join Date
    03-31-2012
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Find cell with specific text in a row, then rearrange the columns

    Thanks Martin,

    The code works great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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