Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Sort by Font Type 2

Status
Not open for further replies.

bamundsen

IS-IT--Management
Dec 5, 2001
58
US
I received a spreadsheet which contains part # updates. Unfortunately, the sender marked all new or modifed part #'s with bold font (the entire row is in bold). Is there anyway I can sort the spreadsheet by font type or return a value of 1 if a cell has bold font? Thanks,

Brett
 
Hi,

Not without VBA code.

copy 'n' paste this code into a MODULE and then
Code:
Function MarkBold(rng As Range)
    If rng.Font.Bold Then
        MarkBold = 1
    Else
        MarkBold = 0
    End If
End Function
use it like any other spreadsheet function with a cell reference.

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
Brett,

This will do as you requested - places the value 1 into Column B. As noted below, you can easily adjust for whatever column you prefer.

Sub BoldFont_Identify()
[a1:a1000].Select 'adjust for number rows
r = Selection.Rows.Count
For i = 1 To r
If Cells(i, 1).Font.Bold = True Then
Cells(i, 2).Value = 1 '2 = Column B
End If
Next i
[a1].Select
End Sub

Regards, Dale Watson
 
Thank you for your replies. I got DaleWatson's to work for me. I will have to look into DigDb. Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top