View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
muddan madhu muddan madhu is offline
external usenet poster
 
Posts: 747
Default How should I do this (function or Visual basic)

sheet 1 has
old cc new cc new cc name
123 222 management
124 333 service
125 444 etc... phone costs


sheet 2 has
phonenumber old cc
0401234 123
0402345 124
0501234 125

sheet 3 - you have phone number in col A
in cell B2 =VLOOKUP(A2,sheet2!$A$1:$B$4,2,0) and drag it down
in cell C2 =VLOOKUP(B2,sheet1!$A$1:$C$4,2,0) and drag it down
in cell D2 =VLOOKUP(B2,sheet1!$A$1:$C$4,3,0) and drag it down

change the range ranges according to your need.


On Nov 24, 2:05*pm, Pasi wrote:
I have one workbook with two different worksheets

In other worksheet there is information what is old cost centre and what is
correspondin new cost centre and new name of that cost centre (cc):

old cc * * * *new cc * * * * * * new cc name
123 * * * * * *222 * * * * * * * * *management
124 * * * * * *333 * * * * * * * * *service
125 * * * * * *444 etc... * * * * phone costs

In other worksheet there is:

phonenumber * * * * old cc
0401234 * * * * * * * *123
0402345 * * * * * * * *124
0501234 * * * * * * * * 125

And I need to get new cost centre number based on corresbonding cost centre
numbers in other worksheet and result is like this:

* * * * * * * * * * search term * * result of search term
phone number * old cc * * * * *new cc * * * * * * name of new cc
0401234 * * * * *123 * * * * * * 222 * * * * * * * * * management
0402345 * * * * *124 * * * * * * 333 * * * * * * * * * service
0501234 * * * * *125 * * * * * * 444 etc * * * * * * phone costs

How should I solve this thing? Is there a function to do that or do I need
visual basic. And plz I need a very strict answer about this...

Thx in advance and sorry my poor english!