Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with lookup code

Which lookup code do I use for the following

On a worksheet I have a row starting with a particular number, what I need
to do is for excel to look for the exact match to the number in the range
"a10:a20", When it finds the match in need the code to copy the entire row
to that number in the range?

some thing like this

a b c d e
1 10
2 11
3 12
4 13
5 14
6 15

13 alpha beta charlie delta echo

if I have 13 in cell "a35" I would like it to copy like this

a b c d e f
1 10
2 11
3 12
4 13 alpha beta charlie delta echo
5 14
6 15


Hope anyone can help

Thanks

Browie



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Help with lookup code

If the list of lookup values is sorted, you can use VLOOKUP. Just use a
slightly different value in each column, e.g. for column B (assuming row 2,
and using LookupTable to stand for your table of lookup values):
=VLOOKUP($A2,LookupTable,2,0)
For column C:
=VLOOKUP($A2,LookupTable,3,0)
and so on...

If not sorted you can use MATCH and OFFSET in the form
=OFFSET(LookupTable,MATCH($A1,LookupTableColumnA,0 )-1,1,1,1)
apply this similarly in each column changing only the 3rd parameter from the
end, which tells how many columns over to read the data from.

"browie" wrote:

Which lookup code do I use for the following

On a worksheet I have a row starting with a particular number, what I need
to do is for excel to look for the exact match to the number in the range
"a10:a20", When it finds the match in need the code to copy the entire row
to that number in the range?

some thing like this

a b c d e
1 10
2 11
3 12
4 13
5 14
6 15

13 alpha beta charlie delta echo

if I have 13 in cell "a35" I would like it to copy like this

a b c d e f
1 10
2 11
3 12
4 13 alpha beta charlie delta echo
5 14
6 15


Hope anyone can help

Thanks

Browie




Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repost of VBA Code/Lookup question Steve_n_KC Excel Worksheet Functions 5 June 23rd 07 01:34 AM
Post code lookup Paul Williams Excel Worksheet Functions 5 November 23rd 06 08:25 PM
Zip Code Lookup Add-in GoFigure Excel Discussion (Misc queries) 12 February 20th 06 08:36 PM
Code Lookup for Number gregork Excel Programming 2 December 20th 04 10:40 AM
code for lookup,& triggers. derek Excel Programming 3 July 22nd 03 05:04 AM


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

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

About Us

"It's about Microsoft Excel"