Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting Text

My spreadsheet has a long string of text in one cell, I only need one word in
the string bolded. I need an automated method due to the number of cells.
Can I capture the data with vba bold part of the string and put it back into
the cell?

Any help would be greatly appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Formatting Text

Here try this procedure... It bolds the word Tada...

Private Sub test()
Dim rngCurrent As Range
Dim intFound As Integer
Dim strToFind As String
Dim intLength As Integer


strToFind = "Tada"
intLength = Len(strToFind)
Set rngCurrent = Sheets("Sheet1").Range("A1")

Do While rngCurrent.Value < Empty
intFound = InStr(rngCurrent.Value, "Bold")
If intFound 0 Then
rngCurrent.Characters(intFound, intLength).Font.FontStyle = "Bold"
End If
Set rngCurrent = rngCurrent.Offset(1, 0)
Loop
Set rngCurrent = Nothing
End Sub

"Vinny Bambarino" wrote:

My spreadsheet has a long string of text in one cell, I only need one word in
the string bolded. I need an automated method due to the number of cells.
Can I capture the data with vba bold part of the string and put it back into
the cell?

Any help would be greatly appreciated.


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
Formatting Text in cells that already have text entered Jennifer V. Excel Worksheet Functions 4 January 13th 09 09:27 PM
copying text within a text box and losing formatting hokiefan1us Excel Discussion (Misc queries) 2 September 17th 08 08:41 PM
Formula Text String: Formatting Text and Numbers? dj479794 Excel Discussion (Misc queries) 5 June 30th 07 12:19 AM
Conditional Formatting based on text within a cell w/ text AND num Shirley Excel Worksheet Functions 2 December 22nd 06 01:40 AM
Conditional Formatting based on Text within Text George Lynch Excel Discussion (Misc queries) 3 May 5th 05 07:58 PM


All times are GMT +1. The time now is 01:39 AM.

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"