+ Reply to Thread
Results 1 to 6 of 6

Check if a corresponding column value is a specific word?

  1. #1
    Registered User
    Join Date
    10-21-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    2

    Lightbulb Check if a corresponding column value is a specific word?

    Hello everyone!

    I hope you can help me with this code fragment: I want to see for each cell if its corresponding C column value contains a specific word. The code below gives the error message: Method Range of object _Global failed. Do you know how should it look like in order to work? Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Check if a corresponding column value is a specific word?

    Welcome to the forum
    You can achieve that without looping
    Try this simple code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Check if a corresponding column value is a specific word?

    It's MUCH faster to use Range.Find than it is to loop through every value in C like you are trying to do. Here's an example:

    Please Login or Register  to view this content.
    It's even faster to load column C into an array and manipulate it that way, it's just not my preferred method.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Check if a corresponding column value is a specific word?

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-21-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    2

    Re: Check if a corresponding column value is a specific word?

    Thank you for the fast responses Here is what my whole task is actually about:

    Please Login or Register  to view this content.
    What I am trying to do with this code is fill a whole row with a color in case there is "example" in one if its cells and at the same time the value of its corresponding cell in N column is smaller than this in J column.
    If a row is already higlighted with this color, to remove the color in case there is a word "yes" in its C column and at the same time the value of its N column is bigger than that in J column.

    EDIT: @John, thanks a lot, by adding ".row" my code is working
    Last edited by toni92; 10-21-2015 at 03:56 PM.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Check if a corresponding column value is a specific word?

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. [SOLVED] Check space before and after specific word
    By makinmomb in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 05-03-2015, 12:43 PM
  2. [SOLVED] how do I format a column to change color when another column has a specific word in it?
    By officegirl14 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2014, 06:15 PM
  3. [SOLVED] If a specific row contains a word, then clear specific content in corresponding column.
    By johansoder in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2014, 05:38 PM
  4. [SOLVED] How to find specific word and sum the column according to that word
    By cobo1981 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-14-2014, 12:04 PM
  5. Move row data to a specific sheet if column contains specific word
    By Kennethc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2014, 06:55 PM
  6. [SOLVED] Seperate data in column A that has specific word and move to column B or C or D
    By jachbo in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-05-2013, 09:08 PM
  7. [SOLVED] How to check if a column contains a certain word?
    By The_Snook in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-22-2013, 08:43 AM

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