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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
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))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,398
Messages
5,831,404
Members
430,064
Latest member
Shahrukh kha

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
Top