access visual basic training - format bold


starstarstarstarstar Excellent

Forum home » Delegate support and help forum » Microsoft VBA Training and help » access visual basic training - Format bold

access visual basic training - Format bold

resolvedResolved · Low Priority · Version Standard

Thu 20 Dec 2007, 16:38 replyReply Delegate Manuela said...

Manuela has attended:
Access VBA course

Format bold

Is it possible to build up a character string and make part of that string bold?

I was hoping that maybe I could concatenate a code for bold to some previous concatenated fields (and text) and then at the end of what needed to be bold I could then concatenate a code to switch it off

No rush for this
Hope my explanation has not been confusing!!


For upcoming training course dates see: Pricing & availability

Tue 29 Jan 2008, 12:30 replyReply Trainer Carlos said...

Format Sections of a String as Bold

Hi Manuela

You cannot bold a variable or part of a string while its a variable, so I'm showing you how to do it after it is placed in a cell.

The code below takes the phrase:

Hello My Name is Carlos. Welcome to Excel VBA

in Range ("A1") and bolds the words "Carlos" and "Excel"

The default code line for this is:

Rng.Characters(Start, Length).Font.Bold = True

The Bracket sets the Start and Length of the section to be made Bold

Sub MakePartOfStringBold()

Dim Rng As Range

Set Rng = ActiveSheet.Range("A1")

Rng.Characters(18, 6).Font.Bold = True 'Bolds "Carlos"

Rng.Characters(37, 5).Font.Bold = True 'Bolds "Excel"

End Sub

Hope this helps


Thu 7 Feb 2008, 12:27 replyReply Delegate Manuela said...

RE: Format Sections of a String as Bold

Sorry for delay in getting back to this.

Thanks for this. Have got this working in Excel but would you know of anything like this that works in Access Reports as my string that I am building up is being output to an Access Report?

Many thanks


Thu 28 Feb 2008, 15:26 replyReply Delegate Manuela said...

RE: Format bold


My further question seems to have been lost in the ether! I was wondering if you could think of a way to do this in Access reports as the string with the bold in it is needed to output bibliographies?

Thanks again
and regards



Live dates & prices


Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


Vba tip:

Suspend DisplayAlerts in VBA

To stop Excel asking you things like "Do you want to delete this file...", use the following line of code at the beginning of the relevant VBA procedure:

Application.DisplayAlerts = False

At the end of the procedure make sure you use the following code to reactivate Display Alerts:

Application.DisplayAlerts = True

View all VBA hints and tips