View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andym Andym is offline
external usenet poster
 
Posts: 35
Default Replacing information from one doc to another if conditions apply

This can just be done with Excel formulas if you would like, rather than
using VBA.

Create a column in each list that concatenates columns A, B, and C. This
will be used as your key to match up the two lists.

Then use formulas at the end of the reroute list to get the correct address.
The formulas could use VLOOKUP to attempt to find a match. If it finds a
match, the formula can be set to the value from the original list. If it
does not find a match, it can be set to the value from the reroute list.
This will require an IF function within the formula.

This can also be done in VBA without too much trouble. If you want to go
that route, I can get you started with some code.

Hope this helps!

"scr" wrote:

I have an original list of addresses. A "reroute" list is provided. If
columns A, B, & C on the original list match columns A, B, & C on the
"reroute" list the addresses in columns D, E, F, G & H must be changed to
the new addresses listed on the "reroute" list columns D, E, F, G & H.

If, however, there is not match then the address in the original list needs
to stay the same.

Any suggestions?