+ Reply to Thread
Results 1 to 15 of 15

Userform Summing Option buttons

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Userform Summing Option buttons

    I was hoping someone could shed a little light on userforms for me, specifically adding in a formula the sum of option buttons.

    So what I mean is I have a list of names in column A which my userform will read, for each name I need to complete a calculation(simple sum) and put the outpu in column K.

    I have three frames each with 4 optionbuttons. Button 1, 2,3 & 4. I was planning to use an offset for each column.

    In the ok/update button what is the best flow to use intially I thinking an if else flow but seemed a little overkill.

    All I want to do is say selection from group one plus selection from group two the selection from group 3.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Userform Summing Option buttons

    Sorry but I do not understand what you are asking. Attach a workbook perhaps?

  3. #3
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    I have attached a sample sheet. Also included an updated description in the sheet which hopefully makes things clearer.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Userform Summing Option buttons

    If you list all the combinations in L1:AL1 (I think there are 27), you could use this formula in L2 and copied across and down:

    =INDEX($C$2:$K$28,ROW()-1,LEFT(L$1,1))+INDEX($C$2:$K$28,ROW()-1,MID(L$1,2,1))+INDEX($C$2:$K$28,ROW()-1,RIGHT(L$1,1))

    See attachment.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    How does the user choose which values are to be calculated using this method?

  6. #6
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    StephenR I am unsure how to use the code to link that to user input. I am only new to VBA so I may be missing something obvious.

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Userform Summing Option buttons

    Must you have option buttons? Why not just ask people to enter the three numbers somewhere?

  8. #8
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    I am importing files from xml input. The user needs to define which option per group(3 columns per group as in spreadsheet) to derive total for each individual.

    So rather than settings ooption buttons are you proposing that the user could write 1 or 2 or 3 or 4 to represent choices per each group? If yes how would that relate to the formula you have posted?

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Userform Summing Option buttons

    They could just type in 3 numbers couldn't they and then a formula or code could look up the relevant column and show the sum?

    If you must have a user form, design it, post it here and then perhaps I or someone can add the code.

  10. #10
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    Yeah thats cool but my main question regarding the userform was that I am looking to find out what sort of flow to use when doing the summing.

    I was concerned that if I had 3 groups of 3 columns then using something such as IF/ELSE for each group of 3 columns might be overkill.

  11. #11
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Userform Summing Option buttons


  12. #12
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    Yes I know I cross posted, I am struggling and asked for help everywhere. I am sorry I am stupid but getting a userform to work is not something I can seem to understand at the moment and I am trying to get.help everywhere. I have read many links to many tutorials but can't find one that succinctly relays how to do what i am trying to do. Not that I am special but just slightly different.

    If I offended anyone I am sorry.

  13. #13
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Userform Summing Option buttons

    It doesn't (IMO) matter that you cross-posted. It does matter that you didn't say so. Please make sure you do in future.
    Remember what the dormouse said
    Feed your head

  14. #14
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Userform Summing Option buttons

    flebber - it's not a question of being offended, but that if you don't say you have done it you are (potentially) wasting people's time on a problem which has already been solved elsewhere.

  15. #15
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Userform Summing Option buttons

    I wouldn't waste anybody's time intentionally. Thats a promise

+ 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