Can I change the formatting of a cell (currency) based on a different cell?

AbrahamGluck

Board Regular
Joined
Apr 12, 2016
Messages
129
Office Version
  1. 365
Platform
  1. Windows
Is there any way for the display formatting to be changed automatically dependent on whether ISO code I write?

ALLLek
AFN؋
ARS$
AWGƒ
AUD$
AZN
BSD$
BBD$
BYRp.
BZDBZ$
BMD$
BOB$b
BAMKM
BWPP
BGNлв
BRLR$
BND$
KHR
CAD$
KYD$
CLP$
CNY¥
COP$
CRC
HRKkn
CUP
CZK
DKKkr
DOPRD$
XCD$
EGP£
SVC$
EEKkr
EUR
FKP£
FJD$
GEL
GHC¢
GIP£
GTQQ
GGP£
GYD$
HNLL
HKD$
HUFFt
ISKkr
INR
IDRRp
IRR
IMP£
ILS
JMDJ$
JPY¥
JEP£
KZTлв
KPW
KRW
KGSлв
LAK
LVLLs
LBP£
LRD$
LTLLt
MKDден
MYRRM
MUR
MXN$
MNT
MZNMT
NAD$
NPR
ANGƒ
NZD$
NIOC$
NGN
NOKkr
OMR
PKR
PABB/.
PYGGs
PENS/.
PHP
PLN
QAR
RONlei
RUB
SHP£
SAR
RSDДин.
SCR
SGD$
SBD$
SOSS
ZARS
LKR
SEKkr
CHFCHF
SRD$
SYP£
TWDNT$
THB฿
TTDTT$
TRL
TVD$
UAH
GBP£
USD$
UYU$U
UZSлв
VEFBs
VND
YER
ZWDZ$

<tbody>
</tbody>
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
First I would declare all of the formatting rules for each type using:

Range.NumberFormat Property (Excel)
https://msdn.microsoft.com/en-us/library/office/ff196401.aspx

Then I would make a VBA macro that uses a "select case" statement on the cell that defines the format for the range of cells you want to format

Code:
Select Case Range("A1").Text[INDENT]Case "ALL"[/INDENT]
[INDENT=2]Worksheets("Sheet1").Columns("C").NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
[/INDENT]
[INDENT]...
[/INDENT]
 End Select

Finally,
I would make a trigger that runs this macro whenever the value of the defining cell is changed using a technique like this:

https://support.microsoft.com/en-us/kb/213612


That should be all the tools you need to get there. Good luck!
 
Upvote 0

Forum statistics

Threads
1,215,269
Messages
6,123,976
Members
449,138
Latest member
abdahsankhan

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