+ Reply to Thread
Results 1 to 5 of 5

Help with a code in userform

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Help with a code in userform

    Variables:
    txtHC = textbox Hours of Access (Input)
    radA = Package A
    radB = Package B
    radC = Package C
    MC = Mounthly Charge (Output)
    • On Package A the charge is $9.95 for 10 hours of access plus $2 for each addicional hour.
    • On Package B the charge is $14.95 for 20 hours of access plus $1 for each addicional hour.
    • On Package A the charge is $19.95 for unlimited hours of access.

    There's also a checkbox to check if the client is from a NonProfit Organization that gives the client 20% of discount on all the packages. The user must enter the hours of access, select a package and the check the checkbox if the client is from a NonProfit Organization or leave it blank if is not. The Output must be the monthly charge.

    I don't know how to make possible to add $2 or $1 depending on the package and the hours of access. For example:

    Client 1: Package A, 5 hours, nonprofit $7.96
    Client 2: Package B, 25 hours $19.95

    On the client 2 it has 25 hours of access and it was selected package B meaning that there are 5 hours of access addionals that must be charge $1 each but I don't know how to do that or the 20% of discount.

  2. #2
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Help with a code in userform

    Also, if this is an actual userform, the code changes a bit. It's best to specify that the objects (like radA) are part of the userform with the phrase Me, like this: Me.radA. Also, you can't refer to radA as a value, you have to refer to the value of radA as an object; like this: Me.radA.value

    Without knowing what your checkbox is called, I can't write code that would apply the 20% off for non-profit, but that should be an easy step later in the code; something like this:
    If Me.CheckBox1.value = True Then
    MC = Round(MC * 0.8, 2)
    End If
    Last edited by bmxfreedom; 11-07-2013 at 08:29 PM.

+ 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. [SOLVED] Userform code fails when the userform is called from a custom ribbon button
    By klonbeck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 03:00 PM
  2. [SOLVED] VB Code to Call Userform in Userform
    By Stonesteel15 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-22-2012, 04:47 AM
  3. Userform code
    By ytrehguodleinad in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-18-2011, 10:59 AM
  4. Help with Userform Code
    By JessFace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2010, 09:57 AM
  5. UserForm Code
    By barkerx5 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-25-2008, 02:34 AM

Tags for this Thread

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