Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Public Sub FindAnywhere() Dim vLook As Variant Dim vMeans As Variant Dim vOut As Variant Dim rFound As Range Dim i As Long Dim nOut As Long vLook = Array("A", "B", "C", "D", "E") vMeans = Array("Apple", "Banana", "Cherry", _ "Dog", "Elephant") nOut = 0 ReDim vOut(1 To 1) For i = 0 To UBound(vLook) Set rFound = Cells.Find( _ what:=vLook(i), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ MatchCase:=False) If Not rFound Is Nothing Then nOut = nOut + 1 ReDim Preserve vOut(1 To nOut) vOut(nOut) = vLook(i) & "=" & vMeans(i) End If Next i If nOut Then _ ActiveCell.Resize(nOut).Value = _ Application.Transpose(vOut) End Sub In article , index wrote: Thanks to you both for your help. Using J.E's advice i have achieved what i wanted to do. However, is it possible to split my return value into cells below one another? ie instead of returning A=Apples, B=Bananas in one cell, is it possible to split the answer into A=Apples B=Bananas Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
search value in 2 columns return value in another | Excel Worksheet Functions | |||
Search a column for a value and return T or F | Excel Discussion (Misc queries) | |||
search and return adjacent value | Excel Discussion (Misc queries) | |||
Search and return | Excel Worksheet Functions | |||
search for and return more than one row in a sheet | Excel Worksheet Functions |