Leo_Polla_Psemata
Registered User.
- Local time
- Yesterday, 21:22
- Joined
- Mar 24, 2014
- Messages
- 364
Hi
In one excel report that I extract from access database, I have two columns which outline mixed currencies, usd or eur.
Before, in the old report, the format was just currency “none” and I had used the below line, it worked just fine.
Now there is a new report which uses mixed currencies and I have to format the number based on another field (field name curr)
which can have only two possible values, E or S. E stands for Eur while S for USD
I have tried the below lines but it captures always the Else, formats all numbers as per Else no matter if the field is E or S
In the first line, i have tried several options such as
If Curr = "E" Then
If Me.Curr = "E"
plus few more attempts
but none of those worked.
What should I do ?
Thanks in advance.
In one excel report that I extract from access database, I have two columns which outline mixed currencies, usd or eur.
Before, in the old report, the format was just currency “none” and I had used the below line, it worked just fine.
Code:
.Range("M4", "N" & i).NumberFormat = "#,##0.00;-#,##0.00"
Now there is a new report which uses mixed currencies and I have to format the number based on another field (field name curr)
which can have only two possible values, E or S. E stands for Eur while S for USD
I have tried the below lines but it captures always the Else, formats all numbers as per Else no matter if the field is E or S
Code:
If ("AF" & i) = "E" Then
.Range("M4", "N" & i).NumberFormat = "_([$€-x-euro2] * #,##0.00_);_([$€-x-euro2] * (#,##0.00);_([$€-x-euro2] * ""-""??_);_(@_)"
Else
.Range("M4", "N" & i).NumberFormat = "_([$$-x-euro2] * #,##0.00_);_([$$-x-euro2] * (#,##0.00);_([$$-x-euro2] * ""-""??_);_(@_)"
End If
In the first line, i have tried several options such as
If Curr = "E" Then
If Me.Curr = "E"
plus few more attempts
but none of those worked.
What should I do ?
Thanks in advance.