+ Reply to Thread
Results 1 to 4 of 4

User Defined Function with If statement, does not work, incorrect code?

  1. #1
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    181

    User Defined Function with If statement, does not work, incorrect code?

    Hi there I am trying to create the following function but I cannot seem to get it working correctly. Any ideas?

    Please Login or Register  to view this content.
    Any help would be grately appreciated.
    Last edited by zbor; 03-07-2014 at 09:24 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: User Defined Function with If statement, does not work, incorrect code?

    ? but is it working at all? results different than expected? error message?

    first - try:
    Please Login or Register  to view this content.
    note thar neither ppid PPiD nor "NPID " are recognized - may be UCASE and TRIM would be usefull?

    PS. edit closing code tag - wrong place and backslash \ instead of slash / used
    Best Regards,

    Kaper

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: User Defined Function with If statement, does not work, incorrect code?

    Change the name, Excel doesn't seem to like Result though I can't find why.
    If posting code please use code tags, see here.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: User Defined Function with If statement, does not work, incorrect code?

    PS. good point Norie, especially that used just in VBA (not as UDF in the worksheet) works well.

+ 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. Trying to create UDF to produce different results depending on different inputs
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 09:58 AM
  2. Cannot get User Defined Function to work
    By spike1988 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2013, 06:22 PM
  3. User Defined Function to work as calculator
    By SAGAR KHOLLAM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-18-2012, 07:31 AM
  4. my user defined function doesn'work
    By an61sa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-21-2012, 01:50 PM
  5. Can't get VLOOKUP to work from user defined function
    By dmcquinn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2010, 02:17 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