+ Reply to Thread
Results 1 to 5 of 5

Creating customized function with many conditions

  1. #1
    Registered User
    Join Date
    10-20-2014
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    11

    Red face Creating customized function with many conditions

    Hi Guys,

    Please help me on the user defined function i have created in VBA considering many conditions.

    Below are the conditions.

    STEP QTY LOT STATUS Result
    SORT1 or SORT2 = 0 or blank PREQ OK
    SORT1 > 0 PREQ Move to Sort1 POSTQ
    SORT1 > 0 POSTQ Move to Sort2 PREQ
    SORT2 > 0 PREQ Move to Sort2 POSTQ
    SORT2 > 0 POSTQ Move to DI


    I tried creating below function however, when I tried to run it with different conditions, I am only getting one result which is "Move to Sort1 POSTQ"

    Please Login or Register  to view this content.
    Appreciate the feedback.
    Thanking everyone in advance.
    Last edited by Leith Ross; 10-21-2014 at 09:32 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Creating customized function with many conditions

    Note : instead of & use AND for your conditions.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Registered User
    Join Date
    10-20-2014
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    11

    Re: Creating customized function with many conditions

    Hi GC Excel,

    thank you so much for helping me. I have tried replacing with AND however results changed to "0" to all conditions.
    do you think I am lacking some codes on my function?

    Thanks again!

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Creating customized function with many conditions

    Ok, try this then.

    Please Login or Register  to view this content.
    note that you should always use "Option Explicit" and declare your variables to avoid problems...

  5. #5
    Registered User
    Join Date
    10-20-2014
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    11

    Re: Creating customized function with many conditions

    Hi GC Excel,

    Thank you sooooo much for the help!!! it worked now!!

+ 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. Creating customized letters based on criteria
    By royalB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2014, 12:40 PM
  2. Customized Workday Function !
    By Fowmy in forum Excel General
    Replies: 7
    Last Post: 08-28-2009, 09:20 AM
  3. Creating Customized Sequence in Excel
    By blue_francis14 in forum Excel General
    Replies: 17
    Last Post: 04-16-2009, 08:31 PM
  4. Replies: 3
    Last Post: 02-28-2006, 05:00 PM
  5. [SOLVED] customized function
    By ravi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2005, 03:05 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