Not able to resolve the following using Index and Match. Column displays Blank or shows nothing

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
Hi
Not able to resolve the following using Index and Match. My column displays blank

Full code is at following : https://www.extendoffice.com/documents/excel/3354-excel-search-multiple-sheets-workbooks.html

First finding a value which is in coulmn 3 of mutiplie sheets i am able to get the value of Xfound.value with the above link
Simultaneoulsy Now want to find the corresponding value of xFound.value in column 6 in the same row but displays blank or shows nothing in .cells(xrow.5) column

rather added the following(in Bold) for index match in the above code reference link

Code:
Sub SearchFolders()
'UpdatebyKutoolsforExcel20151202
Dim _ _ _ _ _ _ _ _ _ _ _ _ _ _  _ _ _ _
Dim Lookup_Range As Range
Dim fRange As Range
Dim fCellValue As Variant

                Set Lookup_Range = xWk.Range("A1:A" & lstRow)
                Set fRange = xWk.Range("F1:F" & lstRow)

         If Not xFound Is Nothing Then
                    xStrAddress = xFound.Address
                End If
                Do
                    If xFound Is Nothing Then
                        Exit Do
                    Else
                        xCount = xCount + 1
                        xRow = xRow + 1
                        .Cells(xRow, 1) = xWb.Name
                        .Cells(xRow, 2) = xWk.Name
                        .Cells(xRow, 3) = xFound.Address
                        .Cells(xRow, 4) = xFound.Value
                     
[B]                     With Application[/B]
[B]                     fCellValue = .Match([xfound.value], xWk.Range("C1:C" & lstRow), 0)[/B]
[B]''''''instead of Xfound.value also i tried individually .Match("B445A12")  --------- stil column 5 dispalys blank[/B]
[B]                    .Cells(xRow, 5) = .Index(fRange, .Match([xfound.value], Lookup_Range, 0))[/B]
[B]'''''WHy my .cells(xRow,5) column showing blank[/B]

[B]                     End with[/B]
End if

Thanks
Nimish
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
With few more efforts i Am Getting Error as #Name in the column.
As I changed the following for clarity
fcellValue to Var1 and added Var2 and removed With.Application..... End with
Code:
Dim Var1 As Variant
Dim Var2 As Variant

Var1 = Application.Match([xfound.value], xWk.Columns(3), 0)
Var2 = Application.Match(xWk.Range("F:F"), xWk.Range("A1:J1"), 0)
.Cells(xRow, 5) = Application.Index(xWk.Columns(6), Var1, Var2)
So my xfound.Value is in column 3(text/String) and want to display its Corresponding value(Numeric) in column 6 in the same row
So not able to display the correposonding value in column 6 but #Name is Displayed

Pl help with correct syntax its Confusing

Thankx
NimishK
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top