Sort Data by Formatting

J

Jane

Is there any way to sort data by its formatting? I have a
list of values some of which are bold and I want them all
to be sorted with the bold ones at the top.

Thanks,

Jane
 
M

Myrna Larson

You could use a VBA function to determine whether the cell is bold or not

Function IsBold(ACell As Range) As Long
If ACell.Font.Bold = True Then
IsBold = 1
Else
IsBold = 0
End If
End Function

Then, on the worksheet, you need to use a formula. Let's say the Bold/non-bold
cells are in column A. In B, put the formula =IsBold(A1) and copy it down.
Then you sort using 2 keys: 1st key is column B sorted *descending*, 2nd is
column A sorted *ascending*.
 
Top