+ Reply to Thread
Results 1 to 5 of 5

my Select Case function is not working correctly

  1. #1
    Registered User
    Join Date
    12-30-2010
    Location
    somewhere, USA
    MS-Off Ver
    Excel 2010
    Posts
    86

    my Select Case function is not working correctly

    I have a simple list of items in one column and quantity per item in the other column. I needed to create a custom function that would pick up the quantity per item and automatically assign a percentage discount per item based on the quantity of that item.

    Please Login or Register  to view this content.
    The function is supposed to pick up by looking at the quantity in the original column and automatically assign a discount based on the quantity for that item. But when I run the function...it's giving me zero for all answers! What am I doing wrong?
    Last edited by DorothyFan1; 10-25-2011 at 08:48 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: my Select Case function is not working correctly

    Please wrap your code in code tags, before the moderators get you...

    Click here - Forum rules
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button.
    Cheers

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: my Select Case function is not working correctly

    Try this
    Please Login or Register  to view this content.
    You could easily do this without VBa
    Please Login or Register  to view this content.
    Hope this helps.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    12-30-2010
    Location
    somewhere, USA
    MS-Off Ver
    Excel 2010
    Posts
    86

    Re: my Select Case function is not working correctly

    Thanks for the tips! I appreciated it. The LOOKUP function was neat to know about but I need this in VBA code because it makes it easier to see the tiers and change the percentages accordingly. The tip about setting the argument as a range was great. I had been trying with setting it as either variant or integer and was getting nowhere.
    Last edited by DorothyFan1; 10-25-2011 at 07:51 AM.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: my Select Case function is not working correctly

    Happy to have helped

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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