+ Reply to Thread
Results 1 to 14 of 14

Find specific phrase in a column and change the row color and its border

  1. #1
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Find specific phrase in a column and change the row color and its border

    I have the table, as shown on left in the appended image, and the final result should be the right one.

    The steps are written as 1, 2, 3 and 4.

    Untitled.png

    I have been trying to tackle this problem since yesterday, so some help will be very welcome.

    Thank You.
    Last edited by kundterra; 03-27-2014 at 03:12 PM.

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    Hi, I shall look at it. Can you upload sample workbook, instead of image? Also I assume varying number of rows, but always data in columns A:E?
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find specific phrase in a column and change the row color and its border

    Thank You. The file is attached.

    Only column A and B are important here.

    Yes, rows are varying, but Columns A:G are always filled.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    Hi,
    find attached file. I think it does what you need. I apply formatting to columns A:E, but it's easy to change if you also need column G to be gray.
    Let me know if this is what you need.

    Buran
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    Hi, use the file attached to this post. I have made a small change to make sure cells in column B are not merged.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find specific phrase in a column and change the row color and its border

    Works beautifully. Thank You.

  7. #7
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    glad that helped. I was thinking about merged cells. note that actually there should be no merged cells in columns C:E, otherwise cell formatting would fail. If there is a chance that cell will be merged - you need to change the macro to unmerge them

  8. #8
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find specific phrase in a column and change the row color and its border

    No. There are no merged cells anywhere in the table. Although I will merge them, but after this procedure.

  9. #9
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    note that you can not have shade on part of a merged cell

  10. #10
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find specific phrase in a column and change the row color and its border

    1) Copy A, B, C columns from the file and paste into the template starting from A8

    2) Copy Macro-v13! Column D to Template! Column I

    3) Copy Macro-v13! Column E to Template! Column O
    Attached Files Attached Files
    Last edited by kundterra; 03-28-2014 at 09:55 AM.

  11. #11
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    Hi,
    copy/paste is simple. But there a lot of other questions. e.g.
    template.xlsx will be opened and always with that name or user will have to browse for a file and open it
    do you need to transfer just the values? I assume yes (i.e. keep format of the template file
    is there going to be only one sheet in the template always?
    that's for start. there may be other questions too

  12. #12
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find specific phrase in a column and change the row color and its border

    Template.xlsx will not be opened but will be in the same directory as the Macro-V13 file. I just need to transfer the values. Yes, there will be one sheet in the template always.

  13. #13
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Find specific phrase in a column and change the row color and its border

    Hi,
    find attached file. I fixed a bug in the formatting.
    There is new macro CopyData. It will copy data from the active sheet to template.xlsx.
    If it is not opened it will try to open it, looking in the same directory where the file is for a file named Template.xlsx.
    It doesn't save the file after data are transferred. It exports it in the same folder as pdf. It will overwrite if there is file Template.pdf in the same folder.
    In my opinion it's better to have the template.xlsx as a template file (i.e. template.xltx) or as a hidden worksheet in the current workbook. Also it may be convenient to have the macros in a add-in with nice RibbonX interface. This way macros will be independent of the file they reside in and always available.
    It's late here in Europe, so we can discuss it tomorrow.
    Attached Files Attached Files
    Last edited by buran; 03-27-2014 at 05:12 PM. Reason: Replaced the attached file

  14. #14
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find specific phrase in a column and change the row color and its border

    Awesome. Thank you.
    Will work on the file myself. Rest, let's discuss it tomorrow.
    Once again, thank you for the help.

+ 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. vba Find specific text font and change color
    By jacgeld in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2014, 08:16 AM
  2. [SOLVED] how to find out if the cell contains a specific phrase in text
    By radvile in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-12-2013, 12:46 PM
  3. Replies: 0
    Last Post: 05-16-2012, 03:03 AM
  4. Change the border color used by Change Tracking
    By Jim Stoaks in forum Excel General
    Replies: 1
    Last Post: 01-20-2006, 05:40 PM
  5. [SOLVED] How to change the default Border, Font Color, and Cell Color
    By Elijah in forum Excel General
    Replies: 3
    Last Post: 11-02-2005, 07:55 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