Bolding

  • Thread starter Thread starter Dale
  • Start date Start date
D

Dale

I have a list with peoples names and then in the adjacent
colums following that I have numbers, with a total at the
end. How can I run a macro that will go through the list
of totals and bold the highest totals?
 
Hi Dale,

You may be able to use conditional formatting, using the Large or Max
worksheet functions as your trigger.
 
You want one cell bolded in each row

Sub BBB()
Dim rng As Range, rng1 As Range, res As Variant
Set rng = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))
For Each cell In rng
Set rng1 = cell.Offset(0, 1).Resize(1, 255)
res = Application.Match(Application.Max(rng1), rng1, 0)
rng1(1, res).Font.Bold = True
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top