Thread: Formatting Text
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
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.