+ Reply to Thread
Results 1 to 3 of 3

Creating a new function which can handle cell references

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Creating a new function which can handle cell references

    Hi

    i was attempting to create a new function using VBA. However i am unable to run it successfully. The most probable reason from my end is my inability to pass the cell references correctly.

    Here's the long function that i want to transform into a new function.

    Please Login or Register  to view this content.
    This function is actually used to lookup a value corresponding to given parameters

    Sample Table:
    Model Company Price
    1 2 3
    iPad Apple 1000
    Galaxy Samsung 2000
    Lumia Nokia 3000

    The resultant new function should be something like
    Please Login or Register  to view this content.
    I have written the VBA code for the same as
    Please Login or Register  to view this content.
    This code doesn't return any compile error. However, when used the only value it returns is "0"

    Pls advise on the corrections required.

    Thanks so much
    Last edited by genobz; 02-22-2013 at 06:04 AM.

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Creating a new function which can handle cell references

    I have not made any real changes but the below function works in my workbook

    Please Login or Register  to view this content.
    I have created the table as per your example and when I try "=value_find("Galaxy",A1:C4,"Price")" it works without a problem and returns 2000
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    02-22-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Creating a new function which can handle cell references

    Hey!! that worked!
    thanks so much

    I have been referring to this forum for quite some time to solve my problems. But this was the first time i had to actually put in my problem in black and white.
    I am really thankful for the prompt solution.

    Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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