+ Reply to Thread
Results 1 to 12 of 12

macro to highlight data containing certain values

  1. #1
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    macro to highlight data containing certain values

    Hello

    I was after some help please.

    I am trying to design a macro that on sheet 4 of my workbook, the rows 1 to 500 are scanned and if any rows in contain the words "resolve wsa" or "resolve list" in column A, then the whole row is then highlighted in a different colour.

    I think this is quite possible but cannot get it to search for those words, i have managed to do bits with macro recorder but not all. Can anyone help please?


    Kind regards

    Joe
    Last edited by sandbach; 11-09-2010 at 06:53 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro to highlight data containing certain values

    Why not use Conditional formatting?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: macro to highlight data containing certain values

    Thanks Roy, Ill give that a go.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro to highlight data containing certain values

    Post back if you need help, but be sure to say which version of excel that you are using

  5. #5
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: macro to highlight data containing certain values

    Thanks, Roy, that does the job!!!

    Very much appreciated.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro to highlight data containing certain values

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  7. #7
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: macro to highlight data containing certain values

    Hello Roy,

    Right i have gone to my workbook to apply the conditional formatting, but i am using excel 2003, and i cant get it to work, will i have to use a macro to highlight the data?


    Kind regards

    Joe

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro to highlight data containing certain values

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro to highlight data containing certain values

    Try this with conditional formatting

    Formula is:=
    Please Login or Register  to view this content.
    Applies to:= your used range.

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  10. #10
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: macro to highlight data containing certain values

    Thank You Roy and Marcol for your help, unfortunately still cannot get it to work, probably from a lack of info on my part!!

    I have now adapted the worksheet so it is representative of the data i am using.

    So in column A if any of the rows contain the words "resolve wsa" or "resolve list" i want it to change colour.

    Hope this explains it better now.


    Kind regards

    Joe
    Attached Files Attached Files

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro to highlight data containing certain values

    Try this

    Formula is:=
    Please Login or Register  to view this content.

    Applies to:= your used range.

    Hope this helps

  12. #12
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: macro to highlight data containing certain values

    that works brilliantly, thank you both very much for all your help

+ 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