+ Reply to Thread
Results 1 to 8 of 8

Trying to build UDF but failed

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Trying to build UDF but failed

    Hello
    I'm trying to build UDF Function

    Please Login or Register  to view this content.
    I'm trying to let the function look at the value of the cell .. If it is an integer the result will be the same
    But if it is not an integer the result should be integer by using the Ceiling Function

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Trying to build UDF but failed

    I don't do much in UDF but at a complete guess have you tried to change your
    'x = '
    To
    'X.value="
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 365 on Win11 (365 on Win11 (desktop), 365 on Win11 (notebook)
    Posts
    8,207

    Re: Trying to build UDF but failed

    Hi, YasserKhalil,

    using an UDF you canīt change the value of any other cell than the one who calls the function. And you should use the name of the Function to return the result.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Trying to build UDF but failed

    Thank you very much for this perfect swift solution

    I'm still learning .. And here in this great forum I'm learning a lot

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Trying to build UDF but failed

    Just a nother point
    What if I want to deal with the numbers directly
    =SpecialCeiling(119.99)
    I have a value error

    I want the function to be flexible : deal with ranges of numbers (integers and decimals of course) and deal with these numbers directly

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Trying to build UDF but failed

    I want the function to be flexible : deal with ranges of numbers (integers and decimals of course) and deal with these numbers directly
    is it possible or not?

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 365 on Win11 (365 on Win11 (desktop), 365 on Win11 (notebook)
    Posts
    8,207

    Re: Trying to build UDF but failed

    Hi, YasserKhalil,

    you started giving the parameter a certain type of object: a range. If you want to be more flexible you should alter that maybe as follows:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Trying to build UDF but failed

    Thanks again for this great solutions
    I appreciate your help

+ 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. How to build this spreadsheet
    By fbeans in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-18-2014, 12:19 PM
  2. [SOLVED] Build Pivot on CSV using VBA
    By winshent in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-15-2013, 09:10 AM
  3. build a udf
    By John2007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-24-2008, 08:07 AM
  4. [SOLVED] how do i build the macro i need?
    By Stuart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2005, 08:00 AM
  5. [SOLVED] Build in Code
    By B.G. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2005, 05:06 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