Sort Data by Formatting

  • Thread starter Thread starter Jane
  • Start date Start date
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
 
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*.
 

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