1,000.00 for dollars, pounds and euros. 1000 for Rupiah
$1,000.00, £1,000.00 and €1,000.00 dor dollars, pounds and euros.
1000.00Rp for Rupiah
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("H14")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0" & _
IIf(Target.Value = "Indonesian Rupiah", "", ".00")
Select Case Target.Value
Case "U.S. Dollar", "Australian Dollar", "Canadian Dollar"
Me.Range("G41").NumberFormat = "$#,##0.00"
Case "Indonesian Rupiah"
Me.Range("G41").NumberFormat = "#,##0.00Rp"
Case "British Pound"
Me.Range("G41").NumberFormat = "£#,##0.00"
Case "European Euro"
Me.Range("G41").NumberFormat = "€#,##0.00"
End Select
endit:
Application.EnableEvents = True
End Sub
Gord
I input the code but it still doesn't work.
Cell G41 stays with the number formatted to zero decimal places on all
selections and no symbol is ever displayed, no matter if I choose
dollars or any other currency.
All the other cells in question stay formatted to two decimal places,
no matter what the currency.
When I make a currency selection a Visual Basic message pops up
saying, "Compile Error: Select Case without End Select" and the "End
Sub" at the end of the code gets highlighted.
I understand if you are losing patience and choose not to reply.
Thanks.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("H14")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
Select Case Target.Value
Case "U.S. Dollar"
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0.00"
Case "Indonesian Rupiah"
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0"
Case "Canadian Dollar"
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0.00"
Case "British Pound"
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0.00"
Case "European Euro"
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0.00"
Case "Australian Dollar"
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0.00"
If Intersect(Target, Me.Range("H14")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
Me.Range("F20:G38, G39:G40").NumberFormat = "#,##0" & _
IIf(Target.Value = "Indonesian Rupiah", "", ".
00")
Select Case Target.Value
Case "U.S. Dollar", "Australian Dollar", "Canadian Dollar"
Me.Range("G41").NumberFormat = "$#,##0.00"
Case "Indonesian Rupiah"
Me.Range("G41").NumberFormat = "#,##0.00Rp"
Case "British Pound"
Me.Range("G41").NumberFormat = "£#,##0.00"
Case "European Euro"
Me.Range("G41").NumberFormat = "€#,##0.00"
End Select
endit:
Application.EnableEvents = True
End Sub