These two subs will apply conditional formatting on the either the selected
column or row to accomplish what you requested. Much later than Cecil, but
I spent so much time I had to at least send them off! If you add to the row
or column, you will need to re-run to extend the formatting to these cells.
Sub format_col()
Dim last_col As Long
Dim col_range As Range
last_col = Selection.Column
Set col_range = Range(Cells(1, last_col), Cells(Cells(Rows.Count,
last_col).End(xlUp).Row, last_col))
With col_range
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual,
Formula1:="=MIN(" & col_range.Address & ")"
.FormatConditions(1).Font.Bold = True
End With
End Sub
Sub format_row()
Dim last_row As Long
Dim row_range As Range
last_row = Selection.Row
Set row_range = Range(Cells(last_row, 1), Cells(last_row, Cells(last_row,
Columns.Count).End(xlToLeft).Column))
With row_range
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual,
Formula1:="=MIN(" & row_range.Address & ")"
.FormatConditions(1).Font.Bold = True
End With
End Sub
hth,
Doug Glancy