access visual basic training - format bold
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

access visual basic training - Format bold

The UK's most regular instructor-led training courses.
Training information: access visual basic training · Excel london

· Low Priority · Version Standard

Format bold

Manuela has attended:
Access VBA course

by - delegate Manuela [4 posts] (2007 Dec 20 Thu, 16:38) replyReply

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!!

Thanks
Manuela

Format Sections of a String as Bold

by - trainer Carlos gold contributer[360 posts] (2008 Jan 29 Tue, 12:30) replyReply

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

Carlos

RE: Format Sections of a String as Bold

by - delegate Manuela [4 posts] (2008 Feb 7 Thu, 12:27) replyReply

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

Manuela

RE: Format bold

by - delegate Manuela [4 posts] (2008 Feb 28 Thu, 15:26) replyReply

Hello

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

Manuela


Related articles

· Company Roles in Visual Basic Training
· What Is Microsoft Excel VBA and How Can It Help You Work Smarter?

Vba tip:

Display Text In a Msgbox On Multiple Lines

When displaying text in a MsgBox you may need to show it over multiple lines. To do this use:

vbCrLf

As in:

MsgBox "The System has detected an error." & vbCrLf & "Contact your System Administrator"

The first sentence in quotes will appear above the second in the MsgBox.

View all VBA hints and tips

Institute of IT Training - Accredited Training Provider Institute of IT Training - Accredited Training Provider Prodigy Platinum Learning Partner Microsoft Office Specialist Authorised Testing Centre

Microsoft Registered Partner
microsoft office
ms office project server

Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz