0

I'm quite new to excel so this could be dumb question. I need to change color for those rows which has suffix .com in their second column. I use OpenOffice but I can change it using Microsoft Excel too.

So the thing I want is:

Change a color of the row which second column value match this regex: "./.com" <= This regex may not be correct.

5
  • Why not conditional or instr techonthenet.com/excel/formulas/instr.php ... It will probably be easier to maintain
    – Dave
    Feb 8, 2016 at 8:31
  • @Dave I don't care if it is a regex, it could be instr but I don't know how to use it since I'm very new in excel.
    – Milano
    Feb 8, 2016 at 8:34
  • Did you try conditional formatting? There are many tutorials and you may have more luck, unless you specifically want to learn VBa? The link I have shows how to use it, also see superuser.com/questions/801609/how-do-i-add-vba-in-ms-office
    – Dave
    Feb 8, 2016 at 8:35
  • Your idea of changing the colour has potential issues with VBa. After you've changed the colour, it doesn't just change back! This means you've changed the rows with .com in... You then insert a new row and run the code again, unless you tell it too, it won't chnage the highlighted colours back. howtogeek.com/howto/45670/…
    – Dave
    Feb 8, 2016 at 8:47
  • Is ".com" the ending of a cell, or could it be in the middle too?
    – Terry
    Feb 8, 2016 at 9:31

1 Answer 1

0

Go to Format -> Conditional Formatting -> Manage and click Add.

In the first two drop-down lists, choose "Cell value is" and "Ends with". In the box, enter ".com" in quotes. At the bottom of the dialog, specify B1:B1000 for the Cell Range.

In the Apply Style drop-down, select New Style... Go to the Background tab and choose a bright color, for example yellow. Then press OK.

Now if a cell in the second column contains "google.com", then it will be highlighted. If it gets changed to something else, for example "redcross.org", then it will no longer be highlighted.

Documentation is at https://help.libreoffice.org/Calc/Conditional_Formatting.

2
  • can't speak for the OP, but I believe the request was for a whole row - can that be applied to a whole row? Feb 8, 2016 at 18:57
  • 1
    Coloring more cells is also possible. See superuser.com/questions/598871/….
    – Jim K
    Feb 8, 2016 at 20:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .