Macro to convert a formula returned text value into an abbreviated text value

Rich_B

Board Regular
Joined
Aug 16, 2014
Messages
239
Hi

I'm not sure if this is possible but if it is I would appreciate some help with it.

I have a column of data in a table returning text values via a formula. They are typically quite long and I would like to shorten them down.

For example:

One of the returned values might be "Wet-Cast (YELLOW)" I would like to shorten this down to "WC".

The entire list of possible values and the shorter versions I would like instead are:

- "Wet-Cast (YELLOW)" convert to "WC"
- "Wet-Cast (WHITE)" convert to "WC"
- "Wet-Cast (RED)" convert to "WC"
- "Semi-Dry" convert to "SD"
- "GRP (WHITE)" convert to "GRP"
- "GRP (RAL)" convert to "GRP"

The sheet is called "FACTORY_PRINTOUTS" and the range I would need the macro to be active in is D11:D40

Thank you

Excel 2007
Win 8.1
PC
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Why not use a lookup table directly in your formula?

=VLOOKUP(Your formula,lookup range for your table,2,0)
 
Upvote 0
Why not use a lookup table directly in your formula?

=VLOOKUP(Your formula,lookup range for your table,2,0)

Thanks for your input JoeMo but if I understand you correctly I don't think it will work as nowhere else in the spreadsheet are the shortened values found. They are at full length, this will be the first time they have been abbreviated.
 
Upvote 0
Thanks for your input JoeMo but if I understand you correctly I don't think it will work as nowhere else in the spreadsheet are the shortened values found. They are at full length, this will be the first time they have been abbreviated.
I'm suggesting you create a lookup table somewhere in your workbook that will list in some column the full values and in the adjacent cells of the next column the desired abbreviations.
 
Upvote 0
I'm suggesting you create a lookup table somewhere in your workbook that will list in some column the full values and in the adjacent cells of the next column the desired abbreviations.

Hi JoeMo

Thank you for getting back to me to clarify what you meant. It worked perfectly.

Have a great day. :)
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,988
Members
449,093
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top