+ Reply to Thread
Results 1 to 10 of 10

Macro to find and mark cells

  1. #1
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Macro to find and mark cells

    Dear All,

    please have a look at the attached workbook.

    On Sheet 1 in Column "O" I have item names.
    On Sheet 2 in Column "A" I have 3-letter codes.

    Notice that the item names end in a 3-letter-code followed by a -suffix.

    The macro should check if the 3letter code is contained in the item name, and if so, it should mark it with an "x" in Column "N".

    In my sample, 3letter code BYA was contained in cell O2, so it marked with with an "x" in N2.

    As my real Workbook has 20,000+ rows, I think a macro would be better than formulas.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to find and mark cells

    We need to check only the 3 letters code before the "-" like BYA in O2 , not the full string ??
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to find and mark cells

    yes, that is correct

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Macro to find and mark cells

    Possibly...
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to find and mark cells

    See next code
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to find and mark cells

    Hi PCI

    thank you! So far so good. But I am sorry, not all items in "O" end with a 3 Letter code + -suffix. The macro stops if an item has not a 3Letter Code or if it ends with a 3Letter code without -suffix.

    Can this be fixed?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to find and mark cells

    Hello elgato74,

    This worked for me on the workbook you posted and with the changes you mentioned.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to find and mark cells

    Okay, specifiactions change a little bit, so try next remake
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to find and mark cells

    Thanks guys !!

    All solutions worked like a charm for me. Muchly appreciated !

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to find and mark cells

    Another code which could go faster when there is a lot of rows..!
    Please Login or Register  to view this content.

+ 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] Macro to find certain dates then mark these with an X .
    By I need excel help in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-24-2018, 08:15 PM
  2. [SOLVED] Find and Mark Cells With Words 2 Characters or Less in Length
    By splendidus in forum Excel General
    Replies: 5
    Last Post: 10-14-2018, 04:22 AM
  3. [SOLVED] Word macro to find end of cell mark
    By velvasi in forum Word Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2014, 08:26 AM
  4. Macro find unknown words and mark containing cell
    By forfiett in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2012, 04:58 PM
  5. [SOLVED] Need help amending a find and mark macro.
    By ANDREWA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2012, 04:07 AM
  6. Find, highlight, mark, cut and paste macro
    By Craig Freeman in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-08-2005, 02:05 PM
  7. [SOLVED] Looping Macro to Find and Mark
    By Big Tony in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 01-26-2005, 06:06 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