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
How do I my find pass word in excel AlShepard Setting up and Configuration of Excel 0 February 6th 06 09:32 PM
find instances & report neighboring values [email protected] Excel Discussion (Misc queries) 7 October 19th 05 07:33 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
Macro - Open Word with Excel macro Bill Excel Discussion (Misc queries) 3 May 23rd 05 11:21 PM
Find all text instances in a sheet and add one number from each row Greg Excel Discussion (Misc queries) 1 January 31st 05 11:45 PM


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