Hello Friends
Could you please help me with the following:
I am using "FIND" method for comparing two columns in 2 spreadsheets. So if cell value in sheet1 matches with cell value in sheet2 then copy multiple columns from sheet2 to sheet1 (similar to what VLOOKUP does but I need to return multiple values if the comparison is true).
Values that I comparing are in Column A in both the sheets. Is match I need to return values from about 20 columns (from sheet2 to sheet1). One value that I am returning is in Column B, I was able to get that working. but other values are in columns starting from M. I do not know how to get those values from Sheet2 to Sheet1.
Following is the portion of code that deals with this FIND method
As you may notice that the following line brings next column (B) back but I do not know how to get other column values. They are in columns from M to Z
Thanks for your help
Rajesh
Could you please help me with the following:
I am using "FIND" method for comparing two columns in 2 spreadsheets. So if cell value in sheet1 matches with cell value in sheet2 then copy multiple columns from sheet2 to sheet1 (similar to what VLOOKUP does but I need to return multiple values if the comparison is true).
Values that I comparing are in Column A in both the sheets. Is match I need to return values from about 20 columns (from sheet2 to sheet1). One value that I am returning is in Column B, I was able to get that working. but other values are in columns starting from M. I do not know how to get those values from Sheet2 to Sheet1.
Following is the portion of code that deals with this FIND method
Code:
Set wsTools = Worksheets("AllTools")
Set wsToolParts = Worksheets("Tools and Parts")
Set ToolPartsRange = wsToolParts.Range("A2:A" & lR)
Set AllToolRange = wsTools.Range("A2:A" & lR3)
For Each ToolPartsCells In ToolPartsRange
Set ToolCells = AllToolRange.Find(What:=ToolPartsCells, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not ToolPartsCells Is Nothing Then
ToolPartsCells.Offset(, 1) = ToolCells.Offset(, 1)
End If
Next
As you may notice that the following line brings next column (B) back but I do not know how to get other column values. They are in columns from M to Z
Code:
ToolPartsCells.Offset(, 1) = ToolCells.Offset(, 1)
Thanks for your help
Rajesh