currency conversion

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

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

Currency conversion

resolvedResolved · Medium Priority · Version 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:

Navigate with keyboard without losing your active cell

If you like using your keyboard to scroll through your excel document, but want to keep your active cell the same, use the scroll lock, and then use your arrow keys to navigate around the document.

View all Excel hints and tips


Server loaded in 0.07 secs.