Hoogste waarde in rij markeren

Vind de hoogste waarde in elke rij en markeer die waarde. Ook als er 2 waarden even hoog zijn. Werkt ook als er een lege rij is.

Sub MarkeerHoogsteWaardeInRij()
  Dim rngRij As Range, Max As Double
  Application.ReplaceFormat.Clear
  Application.ReplaceFormat.Interior.ColorIndex = 7
  For Each rngRij In ActiveSheet.UsedRange.Rows
    rngRij.Replace Application.Max(rngRij.Value), "", SearchFormat:=False, ReplaceFormat:=True
  Next
  Application.ReplaceFormat.Clear
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *