+ Reply to Thread
Results 1 to 4 of 4

Userform option button help

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    6

    Question Userform option button help

    Hello everyone,

    I have a quick question. I have a userform all laid out but now I'm trying to link a range to the optionbuttons selected and average them.

    For example,

    If the user selects the "Small" option button, it will select range "A4:A153"
    Then if the user selects the "Amount" option button, it will select the range that the "Small" employee's "Amount"s fall under so, "C4:C153"

    After the user selects "Small" and "Amount" and enters "OK" then I need to write a code to average the "Amounts" then display a message that states, "The Small employees averaged "Amount."

    I already have the userform built, I'm just confused on how to write a code that takes the options the user selected and finds the averages.

    If anyone has suggested they would be greatly appreciated. Thanks!

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Userform option button help

    Hi hopefully you can use this in your form

    Sean
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Userform option button help

    Hi Sean,

    That kind of works for what I need, but instead of having the totals at the bottom, how would I go about just assigning a range to an option button? That way if I have Small, Medium and Large employees, it'll select their range only. I'm not sure if I'm making sense at all. I'm still new to VBA.

    Thank you so much for your help!

  4. #4
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Userform option button help

    Sorry, not sure what you mean.
    maybe if you upload what you have i could work out what you want?

+ 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