Hi
Hoping someone might be able to help.
I'm trying to get the below code to look in column S for the currency code and apply custom format to the relevant ranges. However it doesn't seem to working on individual rows but just taking the first row currency and applying to the whole range.
Would appreciate any help on how to adapt the code to pick the currency code in each row and work accordingly.
Thanks
Hoping someone might be able to help.
I'm trying to get the below code to look in column S for the currency code and apply custom format to the relevant ranges. However it doesn't seem to working on individual rows but just taking the first row currency and applying to the whole range.
Would appreciate any help on how to adapt the code to pick the currency code in each row and work accordingly.
Thanks
Code:
Sub Macro1()
Dim cl As Range
For Each cl In Intersect(Sheets(1).Range("G7:M50"), Sheets(1).UsedRange)
Select Case cl.Offset(0, 6).Text
Case "EUR": Range("G7:M50,o7:o50").NumberFormat = "€#,##0.00;(€#,##0.00)"
Case "GBP": Range("G7:M50,O7:O50").NumberFormat = "£#,##0.00;(£#,##0.00)"
Case "USD": Range("G7:M50,O7:O50").NumberFormat = "$#,##0.00;($#,##0.00)"
Case "DKK": Range("G7:M50,O7:O50").NumberFormat = "DKK#,##0.00;(DKK#,##0.00)"
Case "SEK": Range("G7:M50,O7:O50").NumberFormat = "SEK#,##0.00;(SEK#,##0.00)"
Case "CZK": Range("G7:M50,O7:O50").NumberFormat = "CZK#,##0.00;(CZK#,##0.00)"
Case "RUB": Range("G7:M50,O7:O50").NumberFormat = "RUB#,##0.00;(RUB#,##0.00)"
Case "TRY": Range("G7:M50,O7:O50").NumberFormat = "TRY#,##0.00;(TRY#,##0.00)"
Case "EGP": Range("G7:M50,O7:O50").NumberFormat = "EGP#,##0.00;(EGP#,##0.00)"
Case "CHF": Range("G7:M50,O7:O50").NumberFormat = "CHF#,##0.00;(CHF#,##0.00)"
Case "INR": Range("G7:M50,O7:O50").NumberFormat = "INR#,##0.00;(INR#,##0.00)"
Case "PLN": Range("G7:M50,O7:O50").NumberFormat = "PLN#,##0.00;(PLN#,##0.00)"
Case "RSD": Range("G7:M50,O7:O50").NumberFormat = "RSD#,##0.00;(RSD#,##0.00)"
End Select
Next cl
End Sub