Conditional formatting between columns in VBA

Asked

Viewed 135 times

0

I need help with conditional formatting.

I have a VBA code to compare two columns, one that is in a hidden tab, contains a series of systems that we use in the company and another one contains a column where these systems are mentioned, but in this second column the systems may be accompanied with additional information and so this 'validation' does not work since the values are not exact.

E.g.:

Column A
HANA_ERA

Column B ASIA-HANA_ERA-PRODUCTION

Do you have any hint of what I could add to the code below for this validation to occur and conditional formatting to work?

Sub Sistemas_Criticos()
'
'
'
Dim rng As Range
    Application.ScreenUpdating = False
    Sheets("_db").Visible = True
Sheets("_db").Select
With Worksheets()
    Sheets("_db").Range("a2", Sheets("_db").Range("a2").End(xlDown)).Select
End With
Sheets("e-Template").Select
With Worksheets()
    ActiveSheet.Range("f8", ActiveSheet.Range("f8").End(xlDown)).Select
End With
    Selection.FormatConditions.AddUniqueValues
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    Selection.FormatConditions.DupeUnique = xlDuplicate
    With Selection.FormatConditions.Font
        .Bold = True
        .Italic = False
        .Underline = xlUnderlineStyleNone
        .Color = -16776961
        .TintAndShade = 0
    End With
    Selection.FormatConditions.StopIfTrue = False
    Sheets("_db").Visible = False

End Sub

Thanks in advance for your comments and suggestions.

  • See the function Urge or conditional with Like operator

  • I took a look and I think it’s not exactly what I’m looking for. Is there something like 'contains' where I can declare a column?

  • See if this answer help you

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.