Prev Previous Post   Next Post Next
  #1   Report Post  
Dkso
 
Posts: n/a
Default Find in a list

Hi,

I have a list of item codes on sheet3 that I wish to compare against another
list on sheet1, and if any of the items in the list on sheet3 match those on
sheet one do something.

I have the following code but think it's very slow and can be improved on,
can anyone help me please?
So far my code only works on one cell on sheet three, it needs to read a
list, one at a time.


Private Sub Find_Store()
Row = 1
found = False

check = IsEmpty(Range("Sheet1!A" & Row))
While (check = False)
a = Range("Sheet1!A" & Row).Text
If a = Cells.Range("c1").Text Then
found = True
foundrow = Row
End If
Row = Row + 1
check = IsEmpty(Range("Sheet1!A" & Row))
Wend
If found = True Then
find_row = foundrow

Else
find_row = -1
End If

End Sub

Please help.

Dean
--

http://www.dkso.co.uk/
http://homepage.ntlworld.com/dkso


 
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
Update master list with other lists Chab Excel Worksheet Functions 0 August 4th 05 03:46 PM
How do I find the cell address of the 2nd largest of a set? Mr. Snrub Excel Discussion (Misc queries) 4 May 30th 05 12:53 PM
How do I find data from a list (or table) and insert it in a row? Bobgolfs56 Excel Discussion (Misc queries) 1 February 3rd 05 12:51 AM
Find a duplicate value within a list? Arla M Excel Worksheet Functions 2 January 26th 05 10:04 PM
How do I find out what items are in one list but not in another l. Michelle Craig Excel Discussion (Misc queries) 2 December 22nd 04 08:32 PM


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