Test for value then format!
Don's code examines the contents of each cell in the range from A2 thru A100
and formats according to contents. Change:
For Each c In Range("a2:a100")
to:
For Each c In Selection
Then you first select any group of cells and then run the macro.
--
Gary''s Student - gsnu200806
"AirgasRob" wrote:
Thanks to Don Guillett I found the below code and it works great. But I need
it to select more than one cell to format. Is it possible to modify the code
to select several cells in the same row?
Sub insertline()
For Each c In Range("a2:a100")
If UCase(c) = "TOTAL" Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub
|