+ Reply to Thread
Results 1 to 3 of 3

Make an UDF accept range or string or number as input

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Make an UDF accept range or string or number as input

    I just posted #10 here.

    http://www.excelforum.com/excel-form...=1#post3387637

    Seems to be under control now but as I tinkered with that UDF I realized that it would be nice to be able to just give a cell reference as a parameter (as it is now) OR be able to put in a string OR a number instead. I sort of solved it for using a string or a cell reference, just a matter of using a variant in the UDF declaration and then assign that variable to a string variable in the beginning of the code. It is the first parameter in the UDF I'm referring to by the way.
    However, what if I need to search for a number instead of a string and I want to be able to put it straight in to the formula?

    I hope this is understandable. If not I can post sample code.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Make an UDF accept range or string or number as input

    You should have posted your UDF as a new problem instead of tacking on to a year old thread. Then opening this one which makes no sense unless one goes back and reads through those other posts in the previous thread.
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Make an UDF accept range or string or number as input

    The tacking on to the old thread is not related to this question, it was simply to correct the bug that was in the original code. Many people may still stumble on that thread and try to use the code.

    As for starting a new thread about "Make an UDF accept range or string or number as input" I agree that is a better approach. I'll do that someday.

+ 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. Type mismatch. How do combine a string and a number to make a range?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2011, 11:17 AM
  2. Cannot make combo box only accept range values
    By SP Brian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2010, 06:48 PM
  3. Something that will accept input values....
    By bart203 in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-06-2009, 04:01 PM
  4. I want the input box to accept letters A-H... but how
    By Dustin S. in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-04-2009, 02:49 PM
  5. 2 cells must have input to accept.
    By Sirishgreen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2007, 09:45 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