Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
Add this line to top of module. Option Compare Text Gord On Mon, 15 Dec 2008 15:40:09 -0800, JLGWhiz wrote: Hey Gord, I like that one. Think I'll save it for future use. "Gord Dibben" wrote: Is the word part of a string or by itself? Do you want to do it Via VBA or just use Conditinal Formatting? Since you posted in the programming group, here is a macro for VBA method no matter where the word is located on the sheet. Sub Bold_Word() Dim rng As Range Dim Cell As Range Dim myword As String Dim start_str As Integer Dim Mylen As Integer Dim N As Single myword = InputBox("Enter the word ") If myword = "" Then Exit Sub Mylen = Len(myword) Set rng = ActiveSheet.UsedRange For Each Cell In rng Cell.Font.Bold = False start_str = InStr(Cell.Value, myword) If start_str Then Cell.Characters(start_str, Mylen).Font.Bold = True End If Next Cell End Sub Gord Dibben MS Excel MVP On Mon, 15 Dec 2008 12:11:02 -0800, suestew wrote: How do I do it? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for bolding and italicizing word strings | Excel Programming | |||
Bolding Subtotals | Excel Programming | |||
Bolding using VBA | Excel Programming | |||
Bolding Row from VB6 | Excel Programming | |||
Bolding | Excel Programming |