+ Reply to Thread
Results 1 to 3 of 3

VBA - Custom function creation

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    2

    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. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA - Custom function creation

    You don't really need a UDF for that. A simple lookup table would do it easily.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    2

    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!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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