# VBA - Custom function creation

1. ## VBA - Custom function creation

Hello,

First of all I'd like to thank you guys for having such a nice place where people can learn some new stuff. I am working with excel for some time already and was thinking to proceed to learn VBA as I am currently facing an issue with a huger formulas which I have to update and I'll for sure make a mistake at one or another cell. So I was thinking if you could assist me to create a custom function.

Description:

 Value Unit Currency Result in USD/USG 1000 MT EUR 3.7003 10 USD USG 10

Function which will do a convertion of Value based on currency and unit of measure into Value in USD / USG.
Probably one function converting value based on one parameter will be enough and to convert second parameter I can use "function inside function" in a formula.
Turning on my logic ( I hope I have at least little logic ) Idea is that I have range of convertion rates like:

 Currency EUR RUR GBP UAH etc.. 1 USD = 0.7277 30.4971 0.62025 8.10337 1.24256

And Function (Value,Currency) will read "Value" from A* and "Currency" from C* cell from Table 1 - compare to Currency name in first row at Table2 and then as a result will convert "Value" by dividing by "Rate" found in Table2 according to Currency name and give me some number.

I believe this is a piece a cake for you guys. Any help is highly appreciated.

2. ## Re: VBA - Custom function creation

You don't really need a UDF for that. A simple lookup table would do it easily.

3. ## Re: VBA - Custom function creation

Hmm, sometimes you do not see the truth when it is in front of you.. Absolutely forgot about Lookup..

Thanks! This will make my life easier!!

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1