Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formatting Text in cells that already have text entered | Excel Worksheet Functions | |||
copying text within a text box and losing formatting | Excel Discussion (Misc queries) | |||
Formula Text String: Formatting Text and Numbers? | Excel Discussion (Misc queries) | |||
Conditional Formatting based on text within a cell w/ text AND num | Excel Worksheet Functions | |||
Conditional Formatting based on Text within Text | Excel Discussion (Misc queries) |