Excel : update attribute name with abbreviations from another worksheet

radhak

Senior member
Aug 10, 2011
843
14
81
So I have this in a column in one worksheet

Account Product Code
Account Status Code

Account Status Description



and the list of abbreviations for each word in another worksheet (two separate columns)
eg:

Account..........acct
Product...........prod
Code..............cd
Status............stat
Description......desc

and I want to generate a column from the first column that looks like:

acct_prod_cd
acct_stat_cd
acct_stat_desc


This would be simple using a database and something like Java. But is it possible to do this in Excel macros?
 

PowerEngineer

Diamond Member
Oct 22, 2001
3,598
774
136
You can do just about anything with VB macros. That said, I try to only use VB macros for things that can't be accomplished using cell formulas. Although the resulting cell formula will be long and (perhaps to some) unappealing, I'd look at using nested SUBSTITUTE functions (acct for Account, prod for Product, cd for Code, stat for Status, desc for Description, and _ for " ").