+ Reply to Thread
Results 1 to 10 of 10

Calculations using VBA custom function w/ provided data

  1. #1
    Registered User
    Join Date
    11-09-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Question Calculations using VBA custom function w/ provided data

    I have datasets concerning 3 categories: vegetable seed, temperature, and germination temperature.

    I want to write a custom function using EXCEL VBA that lets a user input a single vegetable type (using a drop box, preferably) from a given list along with a temperature provided by the user. Once these two factors are entered, I want the macro to pull information from another dataset (individual germination temperature for each vegetable) and calculate two outcomes: germination rate & days to germination.
    These outputs can be triggered using buttons or what have you and presented on any cell in the worksheet.

    Stuck writing the function and really NEED HELP!
    Much thanks,

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculations using VBA custom function w/ provided data

    Why do you need a UDF?

    Seems to me that standard Excel functions will achieve this without needing to re-invent the wheel.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-09-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Calculations using VBA custom function w/ provided data

    A function would work, but a UDF is required for what I am trying to do.

  4. #4
    Registered User
    Join Date
    05-23-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Calculations using VBA custom function w/ provided data

    Can you provide us the data sets? Maybe upload them in an .xlsx?

  5. #5
    Registered User
    Join Date
    11-09-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Calculations using VBA custom function w/ provided data

    Here is the dataset regarding the germination rates
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-23-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Calculations using VBA custom function w/ provided data

    Thanks, it appears that the second data set isn't consistent with the first data set.

    For example, "Beans, snap" versus " Bean, snap" notice the differences are a space and the letter "s".

    There are also more vegetables in the second data set than the first, 37 to 24, was this intended?

    Can you normalize the data into one table? Or at least make the two tables keys analogous so that I can combine them into one table via a VLOOKUP.

    Once we have the data ready we can begin working on the function.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculations using VBA custom function w/ provided data

    Quote Originally Posted by kboyd757 View Post
    A function would work, but a UDF is required for what I am trying to do.
    Why?

    UDFs are always slower than inbuilt functions. What possible advanatage can you secure by using one? Or is this a homework question?

  8. #8
    Registered User
    Join Date
    11-09-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Calculations using VBA custom function w/ provided data

    kelleytr:

    I have further consolidated the data into a simpler pair of datasets.

    THANKS
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-23-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Calculations using VBA custom function w/ provided data

    Thanks kboyd757,

    I believe I made what you are looking for. Take a look at the attachment and let me know if that works.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-09-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Calculations using VBA custom function w/ provided data

    That's just what I was looking for, kelleytr. Thanks for all the help, well done!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Freeze the date provided by today() function
    By mr.amit.ch in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-02-2017, 02:58 AM
  2. Text Box code doesn't work when other combo box is provided by a data
    By agonysWeeper in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2013, 05:42 AM
  3. Countifs in VBA sample data provided
    By bruinsrme in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-19-2013, 06:41 AM
  4. Search from provided data list and return all instances of given criteria
    By dave1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2012, 07:01 AM
  5. Search from provided data list and return all instances of given criteria
    By dave1983 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2012, 06:00 PM

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