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: 50
Default using Find instead of VLOOKUP in search

Using XL97, I知 seeking to search through a list to find those records
that match a criteria, and then for each matching record, place the
result in column 8 of that record. I致e been seeking to use the find
function as it supposedly runs much faster than the VLOOKUP function.
The code shown below performs the find function for one occurrence.
When I learn how to make it work, I知 confident I can include it in a
loop to repeat the operation for multiple occurrences. :

HOW DO I set the value of the cell in the eighth column of the matching
record to the vOurResult???? If tried things like:

Worksheets("Sheet1").Cells(ActiveCell.Row, 9).Value = vOurResult

But the above line places the result on the line where the cursor
happens to be instead of the line containing the matching record.

(Code is plagiarized from:
http://www.ozgrid.com/News/LookUpMatchIndexVBAFind.htm)



Sub FindBillyBrown()
Dim vOurResult
' FindBillyBrow Macro
' Using the Find Method over Vlookup
'
If WorksheetFunction.CountIf(Worksheets("Sheet1").Ran ge("Data"), "Billy
Brown") 0 Then
With Worksheets("Sheet1").Range("Data")

vOurResult = .Find(What:="Billy Brown", After:=.Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Offset(0, 3)

End With

MsgBox vOurResult
End If
End Sub
 
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
IF with Search/Find??? TotallyConfused Excel Worksheet Functions 5 August 1st 08 10:05 AM
data filtering via vlookup or index/match/find or search withwildcard [email protected] Excel Worksheet Functions 10 April 29th 08 02:43 AM
search a string withing a string : find / search hangs itarnak[_9_] Excel Programming 4 October 24th 05 03:19 PM
Can Search find 2 or more "/"? Wind54Surfer Excel Discussion (Misc queries) 2 February 22nd 05 04:31 PM
Search and find Rick K Excel Programming 1 August 21st 03 04:15 AM


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