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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel substring font format for a range 1

Status
Not open for further replies.

mmaddox

IS-IT--Management
May 22, 2002
53
US
I want to select a range of a column that has names in the format "Doe, John" then apply a macro that Bolds from the first character on until it gets to the comma. I found the following macro in HELP which bolds the entire cell content, but how do I do the substring format?

Sub range1()
For Each c In ActiveCell.CurrentRegion.Cells
Selection.Font.Bold = True
Next
End Sub

Any help would be appreciated
 
To my knowledge, Excel does NOT allow for "mixing" of text formatting within one cell.

In a "TextBox", it's possible, but NOT in a cell.

The formatting you choose will apply to the ENTIRE content of the cell.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Hi,
The following code will work...
Code:
    With ActiveCell
        .Font.Bold = False
        .Characters(Start:=1, Length:=InStr(.Value, ",") - 1).Font.Bold = True
    End With
Hope this helps :) Skip,
SkipAndMary1017@mindspring.com
 
Skip,

It sure does help. It's useful code to "keep handy".

...and a STAR to the "VBA Master" ;-)

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top