PDA

View Full Version : Make highlighed cells Bold using VBA



zkm1223
04-23-2012, 06:06 AM
Hi, I want to create a button which changes the highlighted cells and makes them bold. So far I have:

Sub MakeBold()

ActiveCell.Font.Bold = True

End Sub

But this only changes 1 cell. I want it to change ALL the cells which are highlighted.

Any help is much appreciated. Thanks

mikerickson
04-23-2012, 07:12 AM
What determines if a cell is "highlighted"? If its by Conditional Formatting, just change the Format of the Conditional format.

BrianMH
04-23-2012, 07:45 AM
I think he means selected cells.

selection.font.bold = false

Tinbendr
04-23-2012, 07:45 AM
Sub MakeBold()
Selection.Font.Bold = True
End Sub

zkm1223
04-23-2012, 08:31 AM
Thanks for the reply. It works. I also found another way of doing it:

ActiveWindow.RangeSelection.Cells.Font.Bold = True