+ Reply to Thread
Results 1 to 7 of 7

finding first 2 digits in a cell from a row and mark them orange

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    finding first 2 digits in a cell from a row and mark them orange

    Hi all,

    I have excel sheet where I have in a row some serian numbers. When the serial starts with 99, I need to mark this cell with orange. I just don't know how to pull this one. The numbers are in column E and the lengt of the column changes from time to time.

    Any help is more then welcome.

    Greetings.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding first 2 digits in a cell from a row and mark them orange

    Try this code...

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: finding first 2 digits in a cell from a row and mark them orange

    Hi,
    It works, but only if the cell has only 99 in it, if it starts with 998887, it does not find it. I need to select when a cell has a number that starts with 99........

    Thanks for you help, I really appriciate it ;-)

    Greetings

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,789

    Re: finding first 2 digits in a cell from a row and mark them orange

    can you just fill the cell colour or are you looking to mark the characters , I dont think that can be done

    the fill for the cell would be conditional formatting

    =Left(cell,2)=99
    and colour orange

    now in case you alos have text , I have used
    =VALUE(LEFT(A1,2))=99

    see attached
    Attached Files Attached Files

  5. #5
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: finding first 2 digits in a cell from a row and mark them orange

    Sixthsense : your solution seems to look if the entire value in the cell is "99" and then mark yellow. Megatronixs wants to know if the serial number starts with 99...
    I think the code below does what he's looking for.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding first 2 digits in a cell from a row and mark them orange

    Oops oversight error...

    replace this line
    Please Login or Register  to view this content.
    With

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: finding first 2 digits in a cell from a row and mark them orange

    Hi all,

    Thanks all for the fast help. JasperD is right, I needed to find a cell that starts with 99. So the solution from JasperD works perfect for my need.
    I just had no clue that the macro could be so simple (if you know the code). I'm still learning VBA and I must say that it still looks like Chinese to me ;-)

    Thank you all for your solutions.

    Greetings.

+ 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