View Single Post
  #6   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi Andrew,
You don't say exactly how automatically is to happen. How does
the data get into Excel -- is it through a macro. The implication was that
you were not entering the data manually. So expect you have a
macro, and would add additional macro code to it.

Perhaps use of VLOOKUP in the macro after checking that the 3
character is a digit and not a letter from a previous change.
Application.WorksheetFunction.VLOOKUP(...

If you rename flight numbers, if you aren't making things more ambiguous.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Andy100" wrote in message ...
Thanks for the speedy response Max, problem is i already have info in B1,
C1, D1 and E1. I was wanting a way of actually REPLACING the info in column
1 (i.e. BA1234) and REPLACING it with (BAW1234), if you can see what i'm
getting at.

Kind Regards
Andrew


"Max" wrote in message
...
Assuming the data is in col A, in A1 down,
and is identical in structure, e.g. you have

in A1: KL7746
in A2: BA1234
etc

then something like this might suffice

Put in B1:
=VLOOKUP(LEFT(TRIM(A1),2),{"KL","KLM";"BA","BAW"}, 2,0)&RIGHT(TRIM(A1),4)
Copy down

For the sample data, you'd get in B1:B2 :

KLM7746
BAW1234

Adapt to suit ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Andy100" wrote in message
...
How do i get excel to replace words from data imported from the net.

Here is the problem. I am using excel to fetch data from a flight

timetable,
however, when it says "KL" for the flight number, i want it to correct
itself to "KLM". Also, when it says "BA", i want it to correct itself to
"BAW".

i.e. "KL7746" would automatically change to "KLM7746".


Thanks in advance !


Regards
Andrew