View Single Post
 
Old 05-23-2018, 10:30 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by daiwuliz View Post
What would need to change in the formula if the values were text, not numbers?
(We seem to have lost that question)
Based on Text and Numbers in column B:
Code:
Sub blah2()
For Each are In Columns(2).SpecialCells(xlCellTypeConstants, 3).Areas
  Row1Addr = are.Cells(1).Offset(, 1).Resize(, 10).Address(False, True)
  With are.Cells(1).Offset(, 1).Resize(4, 10).FormatConditions
    .Delete
    With .Add(Type:=xlCellValue, Operator:=xlEqual, Formula1:="=" & are.Cells(1).Offset(-1, -1).Address)
      With .Interior
        .PatternColorIndex = xlAutomatic
        .Color = 5296274
        .TintAndShade = 0
      End With
    End With
  End With

  With are.FormatConditions
    .Delete
    With .Add(Type:=xlExpression, Formula1:="=NOT(ISERROR(MATCH(" & are.Cells(1).Offset(-1, -1).Address & "," & Row1Addr & ",0)))")
      With .Interior
        .PatternColorIndex = xlAutomatic
        .Color = 5296274
        .TintAndShade = 0
      End With
    End With
  End With
Next are
End Sub
Reply With Quote