开发者

Performing a find within a find EXCEL VBA

Please help me,

Take for example I have the following set of data:

Column A (Sheet1) | Column B (Sheet1) | Col. A (Sheet4) | Col B (Sheet4) | Col C(Sheet4)

----------1A2B----|---------1111------|-------1111------|--------AAAA----|------ABAB----|

----------2B1A----|---------2222------|-------2222------|--------BBBB----|------AABB----|

----------1B1B----|---------3333------|-------3333------|--------CCCC----|------AABB----|

I already have developed a function code that will find the corresponding value of Column B in sheet 1 to the column A in sheet 4. For example my code will automatically return the values AAAA & ABAB if for all 1111 values in Col B on Sheet 1.

The problem is that if the value in Col C Sheet 4 equals to AABB, i have to perform another search within another table (for example the table is located at sheet 5). And thi开发者_开发百科s time the basis of my seach will be the Col A on sheet 1 because Col A has its own mapping. So i have to perform another search. Can someone please help me with this. I am a newbie when it comes to excel vba. Oh and by the way it has to be on excel vba.

So for example if my code sees the value 2222 on sheet 1 Col B. It will be like this:

Column A (Sheet1) | Column B (Sheet1) | Col. A (Sheet4) | Col B (Sheet4) | Col C(Sheet4)

--------------1A2B----|---------2222----------|-------2222--------|--------BBBB-----|------AABB----|

The code will see the AABB and it will perform another search using the 1A2B code. The 1A2B is mapped to another table.

Please help me.


Sounds like you should use the VLOOKUP worksheet function at both levels. You can use the function in VBA with the following:

Application.WorksheetFunction.VLOOKUP(value to lookup, range to look in, column # to return data from, FALSE)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜