give this a try
Sub Largest_Value_Highlight_Address()
'Determines largest values from the active worksheet
Dim dataSet As String
Dim rng As Range
Dim sValue As Variant
Dim Col As Range
Dim iRow As Long
Dim sAddress As Range
Dim LastRow As Integer, x As Integer
LastRow = Cells(999999, 1).End(xlUp).Row
For x = 2 To LastRow
dataSet = "I" & x & ":AS" & x
Set rng = Range(dataSet)
sValue = Application.WorksheetFunction.Max(rng)
For Each Col In rng.Columns
If Application.WorksheetFunction.CountIf(Col, sValue) > 0 Then
iRow = Application.WorksheetFunction.Match(sValue, Col, 0)
Set sAddress = Col.Cells(iRow, 1)
sAddress.Select
Cells(x, sAddress.Cells.Column).Value = Cells(x, sAddress.Cells.Column).Value - Cells(x, 69).Value
With Selection
.Interior.Color = RGB(255, 255, 0)
End With
End If
Next Col
Next x
End Sub
Bookmarks