Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to chose bold text in a sentence in Excel? Luong Vinh Tu Excel Worksheet Functions 1 September 11th 06 12:46 AM
Excel subtotal function- put subtotals in bold text EPMMGR06 Excel Discussion (Misc queries) 2 August 31st 06 05:47 PM
How do I get selected text within a cell to remain bold in excel? dixielady Excel Discussion (Misc queries) 2 May 27th 06 09:40 AM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM
Using Macros to bold specified text in Excel JulieD Excel Programming 17 March 1st 04 03:35 PM


All times are GMT +1. The time now is 12:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"