Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 2
Default Excel Macro to find instances of a word

I'm in the process of learning VBA and am having some troubles writing
an excel macro to find all instances of a word (usually in conjunction
with other words) and delete the row containing it

essentially I'd like row 5 below to do the following:

If Cell contains word *foo* OR *baz* then

such that it would find individual instances of foo and baz but also
foobar

Although overall a rather large macro, the code surrounding


1 Cells.Sort Key1:=Range("C1")
2
3 totalrows = ActiveSheet.UsedRange.Rows.Count
4 For Row = totalrows To 2 Step -1
5 IF CELLS(ROW, 3).VALUE = **FOO** OR CELL(ROW, 3).VALUE=
**BAZ** Then
6 Rows(Row).Delete
7 End If
8 Next Row

Thanks!

--Chris

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
Multiple Instances Excel07..Excel Paste Special Menu Uses Word PS daddy_dandy Excel Discussion (Misc queries) 1 April 21st 08 03:55 PM
Excel Macro to find instances of a word [email protected] Excel Discussion (Misc queries) 1 April 5th 07 01:30 PM
Find/Replace macro from excel to word Matt[_40_] Excel Programming 4 August 1st 06 03:43 AM
Find/Replace macro from excel into Word Matt[_40_] Excel Programming 0 July 28th 06 04:37 PM
Change the Formatting of All Instances of a word in a worksheet in Excel jaikal24 Excel Programming 3 June 8th 06 08:08 AM


All times are GMT +1. The time now is 04:02 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"