Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Macros to bold specified text in Excel
Hi,
This routine will search the current selection for the specified text. Sub MakeEntryBold() Dim objCell As Range Dim strSubString As String Dim intPos As Integer strSubString = _ InputBox("Enter text to make bold", "Make Entry Bold") If strSubString < "" Then For Each objCell In Selection intPos = InStr(objCell.Value, strSubString) If intPos 0 Then objCell.Characters(intPos, Len(strSubString)) _ ..Font.Bold = True End If Next End If End Sub Need Help wrote: I am trying to create a macro that searches a column for specified text and Bolds or Highlights all instances. This is easy in Word but I couldn't find the feature in EXCEL. Thanks. -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Macros to bold specified text in Excel
Hi Andy
i stand corrected - thanks, very useful bit of code cheers JulieD "Andy Pope" wrote in message ... Hi, This routine will search the current selection for the specified text. Sub MakeEntryBold() Dim objCell As Range Dim strSubString As String Dim intPos As Integer strSubString = _ InputBox("Enter text to make bold", "Make Entry Bold") If strSubString < "" Then For Each objCell In Selection intPos = InStr(objCell.Value, strSubString) If intPos 0 Then objCell.Characters(intPos, Len(strSubString)) _ .Font.Bold = True End If Next End If End Sub Need Help wrote: I am trying to create a macro that searches a column for specified text and Bolds or Highlights all instances. This is easy in Word but I couldn't find the feature in EXCEL. Thanks. -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to chose bold text in a sentence in Excel? | Excel Worksheet Functions | |||
Excel subtotal function- put subtotals in bold text | Excel Discussion (Misc queries) | |||
How do I get selected text within a cell to remain bold in excel? | Excel Discussion (Misc queries) | |||
Join bold and non-bold text in one cell | Excel Discussion (Misc queries) | |||
Using Macros to bold specified text in Excel | Excel Programming |