Suppose one column contains different e-mail addresses, I need to highlight all addresses in yellow - who has e-mail = @ gmail.com. How to do it?

Closed due to the fact that the issue is too common for MSDN.WhiteKnight , 0xdb , user192664, Jarvis_J , user300000 October 25 '18 at 21:01 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See β€œHow to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    3 answers 3

    Select the range of cells in which you need to change the color (where you have the address). Next Home - Conditional Formatting - Rules for Selecting Cells - The text contains ... in the opened window, write the text, which must be in the cell (in your case, gmail.com). Set the color for how the cell will be painted

    • thanks @MaximK !!! what you need :) - Patrick

    Use "Conditional Formatting -> New Rule". There, set the formatting ranges and conditions.

      For cases where you need to quickly view the data for different values ​​of the desired.

      The formatting range is column A. Single cell for the criterion - B2

      Select column A , tab Home-Conditional-Formatting-Create_Rule-Use_ Formula

      =ПОИБК($B$2;A1) 

      Set the desired format (fill).

      Some characters in Excel are reserved for service. For example, if the search text starts at = , + , @ , the text will be perceived as a formula, a function. In order to avoid misunderstandings, the B2 cell format should be set as text.

       ' ----------------- 

      Conditional formatting loads the file, if there are many conditions in the UV, it is possible to slow down when data changes. You can make it easier with VBA (macro).

      Easy to use.

      Alt + F11 - log in to the VBA editor

      Insert-Module tab - creating a common module.

      Expand the module and place the code shown below.

      On the sheet, you can create a button (for example, Insert-Shapes ), which assign the launch of the macro ( RMB-Assign_Macros ).

       ' Π·Π°Π»ΠΈΠ²ΠΊΠ° ячССк столбца А, содСрТащих искомый Ρ„Ρ€Π°Π³ΠΌΠ΅Π½Ρ‚ (ячСйкa Π’2) Sub SearchOfText() Dim ArrData() Dim rRng As Range Dim sStr As String Dim lRws As Long, i As Long With ActiveSheet lRws = .Cells(.Rows.Count, "A").End(xlUp).Row ' послСдняя заполнСнная ячСйка If lRws < 2 Then Exit Sub ' Π΄Π°Π½Π½Ρ‹Ρ… Π½Π΅Ρ‚ (пСрвая строка - шапка Ρ‚Π°Π±Π»ΠΈΡ†Ρ‹) ArrData = Range("A1:A" & lRws).Value ' значСния столбца А Π² массив sStr = .Range("B2").Value ' искомый Ρ„Ρ€Π°Π³ΠΌΠ΅Π½Ρ‚ Π² ΠΏΠ΅Ρ€Π΅ΠΌΠ΅Π½Π½ΡƒΡŽ For i = 2 To lRws ' Ρ†ΠΈΠΊΠ»ΠΎΠΌ ΠΏΠΎ массиву If ArrData(i, 1) Like "*" & sStr & "*" Then ' искомый Ρ„Ρ€Π°Π³ΠΌΠ΅Π½Ρ‚ Π² тСкстС Π΅ΡΡ‚ΡŒ If rRng Is Nothing Then Set rRng = .Cells(i, 1) ' Ρ„ΠΎΡ€ΠΌΠΈΡ€ΡƒΠ΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Else Set rRng = Union(rRng, .Cells(i, 1)) 'пополняСм Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ End If End If Next i Application.ScreenUpdating = False ' ΠΎΡ‚ΠΊΠ»ΡŽΡ‡Π°Π΅ΠΌ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ экрана .Range("A2:A" & lRws).Interior.Pattern = xlNone ' ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠ΅ ΠΏΡ€Π΅Π΄Ρ‹Π΄ΡƒΡ‰Π΅ΠΉ Π·Π°Π»ΠΈΠ²ΠΊΠΈ If Not rRng Is Nothing Then rRng.Interior.ColorIndex = 6 ' красим Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Application.ScreenUpdating = True ' Π²ΠΊΠ»ΡŽΡ‡Π°Π΅ΠΌ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ экрана End With Set rRng = Nothing ' освобоТдаСм ΠΏΠ°ΠΌΡΡ‚ΡŒ End Sub 
      • thank! @vikttur - Patrick
      • To add a macro to the collection? ) - vikttur
      • : D: D thanks, but I don’t know how to use them :) - Patrick