+ Reply to Thread
Results 1 to 5 of 5

find specific word in cell

  1. #1
    Registered User
    Join Date
    08-27-2009
    Location
    Gib
    MS-Off Ver
    Excel 2007
    Posts
    62

    Question find specific word in cell

    Hey,
    I need a vba code that will find all the columns (j) which there cell(1,j) includes the word "Date".
    the word "date" will be a part of a title, for exmple: "due date", "starting date"
    thanks
    Last edited by Abroza; 10-28-2009 at 03:17 AM.

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: find specific word in cell

    Hi

    Here's some code you could use:

    Please Login or Register  to view this content.
    Richard
    Richard Schollar
    Microsoft MVP - Excel

  3. #3
    Registered User
    Join Date
    08-27-2009
    Location
    Gib
    MS-Off Ver
    Excel 2007
    Posts
    62

    Re: find specific word in cell

    that works great, maybe you can help further more...
    I want to continue this code, and after the code findes a column with the word date ( let say column j) , i want to go over all of column j (for row 2 up untill the last row which filled with text) and color in red all the dates that in between [(today+7)-(today)]
    meaning all the dates in the upcoming week. I wany to color only those cells, no need to color in red the "date" cell as befor.
    any chance you can help me?
    thanks alot

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: find specific word in cell

    You could do this using Conditional FOrmatting (it would make it a lot simpler than using code) and this would then automatically update each day:

    1. Select your table data range (for the sake of argument let's assume that it is A1:H1000)
    2. On the Home ribbon select Conditional FOrmatting then New Rule
    3. On the New Formatting Rule dialog select "Use a formula to determine which cells to format"
    4. Type in the following formula:

    =SEARCH("Date",A$1)*(A1>=TODAY())*(A1<=TODAY()+7)

    becareful you copy it exactly as it appears above
    5. Hit the Format button and apply your Red fill. Click OK.

    Richard

  5. #5
    Registered User
    Join Date
    08-27-2009
    Location
    Gib
    MS-Off Ver
    Excel 2007
    Posts
    62

    Re: find specific word in cell

    thanks!
    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