+ Reply to Thread
Results 1 to 10 of 10

Search text and change row color (Excel 2003 VBA)

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    Karachi
    MS-Off Ver
    Excel 2003 + Excel 2010
    Posts
    19

    Question Search text and change row color (Excel 2003 VBA)

    Hi Guys!

    I have a list box which have brand names and linked to cell "A8" I just need that when I select a brand from list box then in a particular data range which is C41:K61 the specific row which contains the same brand name highlight with some color in range column C to K. for example I have selected brand "Dalda" in last combo box then i need the range C42:K42 be highlighted with any color.

    I have attached a picture contains my excel sheet for convenience. any help regarding this in terms of formula or VBA code which can solve my problem will be highly appreciated.
    The form is in excel 2003 format.


    Thanks in Advance,
    Attached Images Attached Images
    Last edited by asgharhussaini; 04-29-2013 at 04:12 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search text and change row color (Excel 2003 VBA)

    Hi asghar,

    Please upload an excel workbook instead of an image so that forum members can give a quick practical shot.. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Search text and change row color (Excel 2003 VBA)

    1. Select range C41:Kxxx
    2. Select Conditional formatting
    3. Select New Rule
    4. Select "Use a formula......"
    5. Put = $A$8 = $C41
    6. Set the format
    7. Select Apply
    Elegant Simplicity............. Not Always

  4. #4
    Registered User
    Join Date
    01-17-2013
    Location
    Karachi
    MS-Off Ver
    Excel 2003 + Excel 2010
    Posts
    19

    Re: Search text and change row color (Excel 2003 VBA)

    Yahooooo. Andy you are genius you just solved my problem in a simplest way

    Dilip thanks very much to you too for taking interest in my query

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Search text and change row color (Excel 2003 VBA)

    Hey!!

    I have attached a file. Please confirm if you are looking for something of that sort?

    Request you to please attach you file.


    Thank You,

    Deep
    Attached Files Attached Files
    Last edited by NeedForExcel; 04-29-2013 at 04:09 AM.
    Cheers!
    Deep Dave

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Search text and change row color (Excel 2003 VBA)

    Conditional Formatting as per Andy's post would be the best solution. Why use VBA if Excel can do the thing..

    Cheers!

    Thank You,

    Deep

  7. #7
    Registered User
    Join Date
    01-17-2013
    Location
    Karachi
    MS-Off Ver
    Excel 2003 + Excel 2010
    Posts
    19

    Re: Search text and change row color (Excel 2003 VBA)

    @msexcelathome your effort is also good but some changes can make it perfect.

    1. Color of row should be immediately change when selecting any text in list/combo box I have to switch cell to see impact.
    2. Can this code change specific range which I exactly required instead of changing whole row color?

    Thanks a Lot for Participating.

  8. #8
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Search text and change row color (Excel 2003 VBA)

    Please see the new file attached as required.

    Can this code change specific range which I exactly required instead of changing whole row color?
    I did not understand you. Could you please clarify more?
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-17-2013
    Location
    Karachi
    MS-Off Ver
    Excel 2003 + Excel 2010
    Posts
    19

    Re: Search text and change row color (Excel 2003 VBA)

    U got my point I just wanted that your code only change color to column D not whole row and the current file u sent contains the solution. Thanks very much.

  10. #10
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Search text and change row color (Excel 2003 VBA)

    Glad it helped!!

+ 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