Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

currency conversion

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Currency conversion

Currency conversion

ResolvedVersion 365

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

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Cycling through Absoulte cell references

If you are working with formulas in excel and need to convert your formula to an absolute formula, instead on manually adding in the $dollar signs you can highlight the specific part of your formula and press the F4 key.

You can cycle through all the absolute options by pressing the button (up to four times)

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.