View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default 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