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: 51
Default lookup

Absolute brilliant

Thanks

Another thing
Assume
Col A Col B
ABC ABC XYZ
ABC 123 ABC

I want match only Col A details with Col B only exact match.

Is application.worksheetfunction.match is the best OR cells.find.....
is the best ?
or is there any better way to match.

Thanks a lot.

On Mar 12, 5:28*pm, "Bernard Liengme" wrote:
This works for me

Sub tryme()
* Worksheets("Sheet2").Columns("D:D").ClearContents
* mytest = Worksheets("Sheet2").Range("A2")
* k = 2
* With Worksheets("Sheet1")
* * mylast = .Cells(Cells.Rows.Count, "A").End(xlUp).Row
* * For j = 1 To mylast
* * * If .Cells(j, 1) = mytest Then
* * * *Worksheets("Sheet2").Cells(k, "D") = .Cells(j, "B")
* * * *k = k + 1
* * * End If
* * Next j
* End With
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVPhttp://people.stfx.ca/bliengme
remove caps from email

wrote in message

...



Hi,


I have worksheet with data as follows :


Col A * * Col B
ABC * * *123
ABC * * *234
ABC * * *345
AC * * * *456
AC * * * *567
AC * * * *678


In Another Sheet I have
Col A
If the user inputs the ABC in cell A2 then
I need in * *Col D
* * * * * * * * 123
* * * * * * * * 234
* * * * * * * * 345


I was using formula
=INDEX(Sheet1!$B$1:$B$10,SMALL(IF($A$2=Sheet1!$A$1 :$A$10,ROW(Sheet1!
$A
$1:$A$10),""),ROW(1:1)),0)


I am looking for VBA solution.- Hide quoted text -


- Show quoted text -


 
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
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM
Lookup Ques - finding value within a string to lookup [email protected] Excel Programming 2 September 25th 05 02:46 AM


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