The spreadsheet is easy to use. You simply enter two three-letter currency symbols , two dates, and specify whether you want the bid, ask or mid price. After clicking a button, the spreadsheet will then connect to a webservice, and download daily bid rates using some clever VBA. As an example, the spreadsheet plots the exchange rate data. If you wanted, you could easily add Bollinger Bands to the plot.
The VBA is not password-protected — feel free to modify, extend or reuse the code, or even learn from the principles embodied therein. Using the VBA programming principles used in the spreadsheet, you can easily use other tools, like Access databases, instead of Excel.
You may also be interested in this spreadsheet which downloads historical stock prices from Yahoo straight into Excel.
Update 29th July I am interested in working this code into an existing workbook I have made. This looks like an awesome tool and will do most of what I need it to do. Hi, I am really interested in the code, im having a few problems getting my workbook to do the same thing but with stock data. I've removed the password from the spreadsheet just download it again. Let me know what you super cool applications you come up with! It looks like a terrific tool to use with excell. Hi, I found your code very useful and have embedded it into one of my sheets.
I would suggest updating the connection on each refresh rather than creating a new one as all of the connections will be refreshed on open unless this property is turned off on creation. The following code will achieve this: Delete Next qt End Sub. Hi, works fantastic for me. I only had a problem using it on a german Excel version as the decimal separator was not correctly recognized. This could be overcome letting Excel know which character to recognize as the decimal separator. Maybe you could include it in your version to help other users who maybe jump into the same problem:.
Thanks a lot, you saved me plenty of time. Thanks a lot for this very useful tool! Just a remark on my side: Try the technique at http: Sam, Thank you for this very useful program. One thing I want to do is input either daily or weekly in the parameters box. It almost works flawlessly! I think the URL you are building in the macro is an old one.
I tried to re-write the macro building a new URL which appears to work but then the section of code which creates the data sheet breaks. Any chance you could have a look? The complete URL which gets me to a csv table is http: So I sort of figured it out.
The URL you used builds a link to a download file, whereas the one I posted above links you to a table on a web page. Plus, if you use bid, ask, or mid it does return different numbers. So thanks very much. I just wish I could have multiple currency pairs in one sheet… or better yet have all of this going straight into powerpivot!
Samir — awesome — time saving and easy to use. OANDA has changed its website in the past days. Data is no longer available. Do you have a solution? I am using a macro I built from scratch 2 years ago but I cannot find a good source website now to get exchange rates. I appreciate your feedback. The are not matching up. Are you providing the daily average? I double checked today again and I am getting weekend results. Thanks for such good website. However, I am also looking if there is any possibility to get the rates from Oanda.
Thank you very much. When I try to embed the code into my existing workbook I get a runtime error however. Any ideas why this occurs? I need to know if it is possible to get data as below: On a particular date, if we need exchange rate for these many currencies. Can it be possible through adjustment in above coding. Hello there, is there any solution for this request since the rest of the code and way of exporting information is perfect only need this to implement it in my sheets so it can populate all currencies needed at once.
OANDA now has also changed the historical data page and calls it …historical-rates-classic. I tried to code my macro to download from this page but I guess they also changed the format of the date in the link. I checked with your excel sheet, ForexExcelImport. Do you know of another website that has historical forex data that I can download with the definition of a period?
I guess, you have not downloaded correct sheet. Your means of describing the whole thing in this post is actually nice, all be able to simply be aware of it, Thanks a lot. This is excellent, thanks Samir! The code is just fantastic and works fine on my US laptop! I only had a problem using it on a german Excel version in my office as the decimal separator was not correctly recognized. I am trying to use this tool to streamline some financial information but there seems to be a bug in the code I downloaded.
No matter what I fill in in the excel sheet, the code always seems to extract the same period between today and a month ago, whereas I need much older data. How far back does the code go? AS Simon said this is not working properly anymore? Is there any alternative way of getting the data? Could this be fixed? I download the latest version of ForexExcelImport.
This spreadsheet is really awesome. I am looking to expand the date range, however, it appears that the data is being drawn from a csv file which is automatically set to the last 30 days. How do you code the excel spreadsheet to draw from the csv file from the past 1 year? Hi there — thanks for producing this spreadsheet it is very useful!
Is it possible to have a version without a password for the code? Hi, looks like the Oanda link in the Macro for historical FX rates has stopped working. This may be due to Oanda stopping providing the service for free. Any idea what the syntax would be for getting the FX data from Yahoo Finance? I only discovered your tool two or three months ago and have enjoyed convenience and accuracy the macro has allowed me to build reports for work for internal use, not a publicly traded company , but it appears that sometime since April 1 Oanda has changed something in the structure of their databases that renders the workbook outdated.
I discovered there was a problem when I started updating my reports for April data and the macros did not update my main table as I expected. This tool was amazing and curious if there is a fix or something similar? Your email address will not be published. Premium Excel Tools Kudos Baby. Hi It looks like a terrific tool to use with excell.
When you loaded the spreadsheet in Excel, did you give the macro permission to run? I tried the worksheet.
Refresh Another approach would be to delete all existing connections before adding a new one: It is possible to modify to show the open, high, low, and close? Thanks in advance , Lance. Maybe you could include it in your version to help other users who maybe jump into the same problem: Hi Sam, Thank you so much for this. You can now choose either the bid, ask or mid rate. Impressive tools for the data-driven!
I have 2 questions for you: If you could spare a moment to address these I would be very appreciative. Hi, Thanks for such good website.More...