Sanjhali has attended:
Excel VBA Introduction course
Currency conversion
Can someone help me code how to do currency conversion to USD (column C) when i have spotrate for EUR (column A)
So basically , i need the response in column c.
column A column B Column C
Spotrate (into EUR) Currency convert into USD
0.897 USD 1
1 EUR = 1 / 0.88715959
1.181 GBP =1.19052667 / 0.88715959
RE: currency conversion
Hi Sanjhali,
Thank you for the forum question.
I assume that you want to loop through many rows.
You can use any of the loops, you saw on the course.
To calculate columns you need to start from the destination cell. Then you need to reference the columns by offsets.
In the example below I just want to loop through all rows and divide divide column A by column B
Sub ConvertCurrency()
Range("A2").select
Do until Activecell.value=""
Activecell.Offset(0,2).value=Activecell.value/Activecell.Offset(0,1).value
Activecell.Offset(1,0).select
Loop
End sub
I hope this make sense and make it possible for you to do what you want.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector