I am trying to write a macro the which uses conditional formats and looks in a specific column, ignores empty cells, finds the minimum value, and then changes the colour of a cell in a different column but on the same row, here is my attempt up to now, my macro looks in column N for the min value, but its the cell in column C on the same row as the min value i want to colour, the macro then does the same with column O
Sub Macro1()
'
' Macro1 Macro
' Keyboard Shortcut: Ctrl+m
'
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=N1=MIN(N$1:N$120)"
Selection.FormatConditions(1).Interior.ColorIndex = 34
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=O1=MIN(O$1:O$110)"
Selection.FormatConditions(1).Interior.ColorIndex = 40
End With
End Sub
Hope this makes sense
Sub Macro1()
'
' Macro1 Macro
' Keyboard Shortcut: Ctrl+m
'
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=N1=MIN(N$1:N$120)"
Selection.FormatConditions(1).Interior.ColorIndex = 34
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=O1=MIN(O$1:O$110)"
Selection.FormatConditions(1).Interior.ColorIndex = 40
End With
End Sub
Hope this makes sense