Hi Experts,
Need your help/feedback in how to find a value in a cell. After finding store it in next column.
[pre]
1) Source file (array)
ItemId
I1001
I1005
I1004
I1993
I3940
2) Target file (Sheet1)
Column A Column B Column C
Date CustomerId Itemid
1/1/2017 C0001 I1005,I1004
1/2/2017 C0007 I3950,I1994
1/3/2017 C0079 I1004,I1993
[/pre]
3) E.g. From Source select an id I1004 and search in Target file,
On finding value in a cell, store the found value in next column of the row.
if not found do until all source file is scanned
Thanks,
Ken
Need your help/feedback in how to find a value in a cell. After finding store it in next column.
[pre]
1) Source file (array)
ItemId
I1001
I1005
I1004
I1993
I3940
2) Target file (Sheet1)
Column A Column B Column C
Date CustomerId Itemid
1/1/2017 C0001 I1005,I1004
1/2/2017 C0007 I3950,I1994
1/3/2017 C0079 I1004,I1993
[/pre]
3) E.g. From Source select an id I1004 and search in Target file,
On finding value in a cell, store the found value in next column of the row.
if not found do until all source file is scanned
Code:
sub proc_Lookup
dim strSource, strCheck, strResult, strTarget as string
dim i, iLen, iMidStart, iInStr as integer
'SourceList
dim Arry(5) as string
Arry(1) ="I1004"
Arry(2) ="I1005"
Arry(3) ="I1993"
Arry(4) ="I3940"
Arry(5) ="I1001"
Workbooks("Target.xls").activate
Worksheets("Sheet1").activate
[COLOR=#EF2929]
[b]Step - need help
1) To search Arry(1) value in Sheet1 of each row
2) if found add value in column D of the row found till the end of sheet1 that has value
3) if not found select next arry and do step 2[/b]
[/color]
end sub
Thanks,
Ken