Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to change format for an individual word in a cell
Hi,
I would like to change bold a single word in a cell that has multiple words. I tried to use find and replace, but the whole cell is bold instead. Example: B1 contains "Washington Apples". I want to bold all the "Apples" found in the worksheet. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to change format for an individual word in a cell
Hi Jaysan
Try using this macro. All you would do is select a worksheet, run the macro, enter the word you want to make Bold then click ok. It will find the word anywhere in the sheet and make it bold. Hope this helps Sub BoldChosenWord() Dim rng As Range Dim xloop As Long Dim cll As Long Dim word As String Dim wordLength As Long Dim CllText As Variant Dim wordStart As Long Set rng = ActiveSheet.UsedRange cll = rng.Count word = InputBox("What word?", "Bold A Word", vbOKCancel) If word = "" Then Exit Sub wordLength = Len(word) For xloop = 1 To cll CllText = rng.Item(xloop) If InStr(CllText, word) 0 Then wordStart = InStr(CllText, word) rng.Item(xloop).Characters(Start:=wordStart, Length:=wordLength). _ Font.FontStyle = "Bold" End If Next xloop End Sub Stuart www.insightmodelling.co.uk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format individual coloumn cell with corresponding coloum cell resu | Excel Worksheet Functions | |||
Format row color based on individual cell | Excel Discussion (Misc queries) | |||
Change individual cell heights/widths in Microsoft Excel 2000 like Microsoft Word | Excel Discussion (Misc queries) | |||
How do I add a hyperlink to an individual word in an Excel cell? | Excel Discussion (Misc queries) | |||
How do I change the width of an individual cell? | Excel Discussion (Misc queries) |