Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Bold some of the cell contents

Thanks for taking the time to read my question.

It is possible to apply the Bold font setting to an entire cell. It is also
possible to apply the Bold setting to portions of text in a cell and leave
the remaining portions unbolded (if that's a word...).

How can you do that in VBA?

Ex:

Activecell.value = "The Number Is 550055"

I want "550055" to be bold, and the rest not bold.

How do I do this in VBA?

Thanks,

Brad
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Bold some of the cell contents

ActiveCell.Characters(15,6).Font.Bold = True

worked for me.

--
Regards,
Tom Ogilvy



"Brad" wrote in message
...
Thanks for taking the time to read my question.

It is possible to apply the Bold font setting to an entire cell. It is

also
possible to apply the Bold setting to portions of text in a cell and leave
the remaining portions unbolded (if that's a word...).

How can you do that in VBA?

Ex:

Activecell.value = "The Number Is 550055"

I want "550055" to be bold, and the rest not bold.

How do I do this in VBA?

Thanks,

Brad



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Bold some of the cell contents

one way:

Const sPREFIX = "The Number Is "
With ActiveCell
.Value = sPREFIX & 550055
.Characters(Len(sPREFIX) + 1).Font.Bold = True
End With




In article ,
"Brad" wrote:

Thanks for taking the time to read my question.

It is possible to apply the Bold font setting to an entire cell. It is also
possible to apply the Bold setting to portions of text in a cell and leave
the remaining portions unbolded (if that's a word...).

How can you do that in VBA?

Ex:

Activecell.value = "The Number Is 550055"

I want "550055" to be bold, and the rest not bold.

How do I do this in VBA?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Bold some of the cell contents

Try something like

Dim Pos As Integer
ActiveCell.Value = "The number is 123"
Pos = InStrRev(ActiveCell.Value, " ")
ActiveCell.Characters(Pos + 1, 999).Font.Bold = True



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Brad" wrote in message
...
Thanks for taking the time to read my question.

It is possible to apply the Bold font setting to an entire
cell. It is also
possible to apply the Bold setting to portions of text in a
cell and leave
the remaining portions unbolded (if that's a word...).

How can you do that in VBA?

Ex:

Activecell.value = "The Number Is 550055"

I want "550055" to be bold, and the rest not bold.

How do I do this in VBA?

Thanks,

Brad



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Bold some of the cell contents

Perfect Tom!

Thanks,

Brad

"Tom Ogilvy" wrote:

ActiveCell.Characters(15,6).Font.Bold = True

worked for me.

--
Regards,
Tom Ogilvy



"Brad" wrote in message
...
Thanks for taking the time to read my question.

It is possible to apply the Bold font setting to an entire cell. It is

also
possible to apply the Bold setting to portions of text in a cell and leave
the remaining portions unbolded (if that's a word...).

How can you do that in VBA?

Ex:

Activecell.value = "The Number Is 550055"

I want "550055" to be bold, and the rest not bold.

How do I do this in VBA?

Thanks,

Brad




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alphabetically list of last names: BOLD, not bold Lerner Excel Discussion (Misc queries) 16 March 1st 09 07:46 PM
Alphabetically list of names BOLD and NOT bold Lerner Excel Discussion (Misc queries) 13 March 1st 09 02:37 PM
Add only cells whose contents are in "Bold" oisinirish Excel Discussion (Misc queries) 3 February 22nd 09 07:30 PM
change cell contents to bold dave@penneys Excel Worksheet Functions 5 September 20th 07 08:25 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM


All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"