LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Finding text in one column that compares to another

In a spreadsheet I have one column with single item names and a second column
with strings of data. I am trying to set up a routine that will search the
column with strings for the names found in the first one. The result needed
is to place the name in a third column adjacent to the one with the string
that contains the name. I have come up with this:

If InStr(Range("B2"), ActiveCell) Then Range("C2") = ActiveCell
If InStr(Range("B3"), ActiveCell) Then Range("C2") = ActiveCell
etc.

This works if I use "Offset" and type a separate line of code for each row
of data but this is rather inconvenient since there are over 1000 rows.

Is there a better way to accomplish this?

Thanks for any help anyone may offer.


 
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
Fix EXACT function so it always compares in the same row. soilcon1 Excel Worksheet Functions 5 January 7th 08 04:45 PM
Finding data in a text column Secret Squirrel Excel Discussion (Misc queries) 4 November 10th 07 05:23 PM
Function that compares dates getravel Excel Worksheet Functions 2 April 11th 06 06:32 AM
Finding Duplicate text strings with a single column Ed P Excel Worksheet Functions 2 March 17th 05 03:56 AM
Macro query - finding mutliple occurences of text in a column Mcneilius[_3_] Excel Programming 2 September 1st 04 08:00 PM


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