LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Look up - HELP!!!

Hi everyone,

I am having alot of trouble doing simple look up due to my limited
knowledge in VBA.

I have list of codes in column B:B and code consist of letter &
numbers.
i.e. A123, B111 so on...

I just want to find a particular code that I want and return 3
prevoius codes and 2 codes after.
i.e.

if code that I want to search is "B111" and if range(B1:Bn) are as
follows;

B
1 A123
2 D892
3 Z2812
4 B111
5 E918
6 U192
7 ....

I want to return A123, D892 and Z2812 = 3 previous codes & E918 and
U192 = 2 codes after the look up value in columns. If there are
multiple look up value in the column, How do I make it look for the
next "B111" in this case then perform the same step?
i.e. if "B111" is found in B100 ( get B99,B98,B97 and B101,B102) and
return it in columns (Starting from column D, to X number of columns)
if there are 10 "B111", then first result will be in column D, second
finding will be in column E and so on.


I tried autofiltering, I tried using offset I tried everything but I
just can't get the end result that I wanted.

if anyone can help, that would be much appreciated.




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"