Macro to copy formatting

BokiB

New Member
Joined
Jul 19, 2010
Messages
40
Hey,

I am looking for help on a very specific issue.

Let's say you have cell A1 and A2. And on the same worksheet I have a list of 20 countries (D1:D20) and right next to it (E1:E:20) the cells are formatted according to currency (so D1 has USA and E1 is formatted with currency $)

I am looking for a macro which can combine LOOKUP and copying the formatting. So if cell A1 states USA, it will search through the list and the formatting in cell A2 will be formatted with $.

Thanks for your help!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
It wouldn't be in numeric format but you could do this:
Excel Workbook
ABCDE
1USA$100.00100GBP#,##0.00
2GBP43.4043.4USA$#,##0.00
3Euro#,##0.00
Sheet1
Excel 2002
Cell Formulas
RangeFormula
B1=TEXT(C1,VLOOKUP(A1,$D$1:$E$3,2,0))
B2=TEXT(C2,VLOOKUP(A2,$D$1:$E$3,2,0))
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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