I have a Excel Sheet with Macros in it. I want to change the entire column bold when I click on associated button. The click should also unbold all other bold columns.
Public row As Integer, VerticalRange As Range
Sub Sort_Macro_C()
Set VerticalRange = Worksheets("Sheet1").Range("b9:b1000")
Worksheets("Sheet1").Range("c9:c1000").Font.Bold = True
row = Application.WorksheetFunction.CountA(VerticalRange) + 10
Range(Cells(10, 2), Cells(row, 16)).sort Key1:=Range("C9"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
End Sub
The above code bolds the entire column but I am not figuring out how to unbold the remaining columns. Any help is appreciated.
Cheers.
Try like this:
Worksheets("Sheet1").Cells.Font.Bold = False
Worksheets("Sheet1").Range("C9:C1000").Font.Bold = True
First it will unbold anything, and then it bolds only the Range("C9:C1000"). If you do not have merged cells, you may use one of the following two:
Worksheets("Sheet1").Range("C:C").Font.Bold = TrueWorksheets("Sheet1").Columns(3).Font.Bold = TrueConcerning that you are working with Selection, if you want to bold the all the column of given selection, you may use this:
Selection.EntireColumn.Font.Bold = True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With