?
Solved

Excel 2010:  .VBA Code for Bolding Text

Posted on 2013-02-01
10
Medium Priority
?
267 Views
Last Modified: 2013-02-04
I have a macro that uses "vbred" color to highlight items in my spreadsheet.  Is there a way to bold this?   i.e. "vbred bold"  Thanks.
0
Comment
Question by:itsmevic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 13

Expert Comment

by:Shanan212
ID: 38844568
Considering your items are selected prior to coloring them

Selection.Font.Bold = True

Open in new window

0
 
LVL 48

Assisted Solution

by:Martin Liss
Martin Liss earned 664 total points
ID: 38844572
Just add


    Range.Font.FontStyle = "Bold"
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38844574
Hi, itsmevic.

myCell.Font.Bold = True

Regards,
Brian.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:itsmevic
ID: 38844805
Here's the portion of my code that specifies what color.  Where would I need to add the change at to make this work?

For Each matchResult In matches
                    ' highlight
                    If isHighlight Then
                        cell.Characters(matchResult.FirstIndex + 1, matchResult.Length).Font.Color = vbGreen
                        cell.Interior.Color = vbYellow
                    End If

Open in new window

0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 38844820
After line 5
cell.Font.FontStyle = "Bold"
0
 
LVL 13

Assisted Solution

by:Shanan212
Shanan212 earned 668 total points
ID: 38844837
Try this

For Each matchResult In matches
                    ' highlight
                    If isHighlight Then
                        activecell.Characters(matchResult.FirstIndex + 1, matchResult.Length).Font.Color = vbGreen
                        ActiveCell.Font.Bold = True
                    End If 

Open in new window

0
 
LVL 26

Accepted Solution

by:
redmondb earned 668 total points
ID: 38844981
itsmevic,

For Each matchResult In matches
                    ' highlight
                    If isHighlight Then
                        cell.Characters(matchResult.FirstIndex + 1, matchResult.Length).Font.Color = vbGreen
                        cell.Interior.Color = vbYellow
                        cell.Font.Bold = True
                    End If

Open in new window

Regards,
Brian.
0
 

Author Closing Comment

by:itsmevic
ID: 38852016
Awesome input from all.  Thank you!
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 38852042
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2012
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38852151
Thanks, itsmevic!
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question