Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection.Find.Replacement.ClearFormatting


I need to set the word "testing" and "result" in all my cells on
particular page to underlined. Normally I would do this manually
however, as there are so many items (over 2000 rows) I was hoping
could write a macro to solve this.

Here is what I've come up with;however, I get an error on the firs
line (excel 2003)

Sub UnderlineWord()

Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Underline = True
With Selection.Find
.Text = "testing"
.Replacement.Text = "testing"
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

I've tried doing a replace funtion using formatting; however, Exce
changes the entire contents of the cell to underlined when it change
one word. The cell has multiple rows in it with ALT-Returns and need
to only underline the words "testing" and "result"

I think the code is close but I'm missing something.

Thanks in advance to anyone that can help :

--
TheYellowDar
-----------------------------------------------------------------------
TheYellowDart's Profile: http://www.excelforum.com/member.php...fo&userid=2654
View this thread: http://www.excelforum.com/showthread.php?threadid=39816

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 can I find the series selection tab? Kat @ Rose Valley Charts and Charting in Excel 1 October 6th 09 06:04 PM
Find Option replacement erick-flores Excel Discussion (Misc queries) 1 February 8th 08 09:11 PM
Find selection C3 Excel Programming 1 April 5th 04 12:37 PM
Use of Selection.Find & ActiveCell Steve Slechta[_2_] Excel Programming 4 November 19th 03 02:07 PM
Find the row of all cells in a selection TonyJeffs Excel Programming 1 September 1st 03 05:05 PM


All times are GMT +1. The time now is 03:17 PM.

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

About Us

"It's about Microsoft Excel"