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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,216,099
Messages
6,128,820
Members
449,469
Latest member
Kingwi11y

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