LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find Whole Word Only

"Lonely" ha scritto nel messaggio
...
| Hi All,
| I need to replace the text "NS" from all the cells in all the
| worksheets of an Excel workbook. I wish to design a macro that can help
| me do this along with the use of something that would allow me to do
| the "Find Whole Word" option similatr to the one we have in MS Word.

see also
newsgroup: this
thread: most popular word
date of thread: dec 8, 2003
date of post: today

Sub nsWord()
Dim w As Worksheet, c As Range
Set regexp = CreateObject("VBScript.RegExp")
regexp.Global = True
regexp.IgnoreCase = True
regexp.Pattern = "\bns\b"
For Each w In ActiveWorkbook.Worksheets
Set rng = w.UsedRange
For Each c In rng
c = regexp.Replace(c.Text, "")
Next
Next
End Sub
.f
fernando cinquegrani
Microsoft MVP
http://www.prodomosua.it



 
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 find a particular word? Jack Excel Worksheet Functions 20 December 2nd 09 12:04 PM
How to find the first Word in a range ? BaggieDan Excel Discussion (Misc queries) 3 July 10th 09 08:27 AM
where do i find word document darlingdiaz New Users to Excel 3 January 24th 07 04:33 AM
Find last word in a string clearwaterdave Excel Discussion (Misc queries) 8 July 28th 06 07:01 PM
Find a word and then take certain action, else John Grossman Excel Worksheet Functions 1 January 10th 05 05:08 AM


All times are GMT +1. The time now is 01:36 AM.

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"