+ Reply to Thread
Results 1 to 20 of 20

Userform question about IF w/outputs on multiple lines

  1. #1
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Userform question about IF w/outputs on multiple lines

    I'm trying to get a form going for our tennis rankings.

    Check the file, my code for checking if a player played and keep his score, and opponants score is long and flawed:

    Please Login or Register  to view this content.

    Only the last guy ticked gets his name on the "Résultats" sheets.
    can someone help me simplify?
    Attached Files Attached Files
    Last edited by Sibrulotte; 03-23-2012 at 11:45 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: We play tennis- I keep score (Userform question about IF)

    Not a solution to the problem but can't you shorten this to:

    Please Login or Register  to view this content.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: We play tennis- I keep score (Userform question about IF)

    Does this work?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: We play tennis- I keep score (Userform question about IF)

    Only the first guy checked comes out on the list.
    All players that we're checked need to get listed.

  5. #5
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: We play tennis- I keep score (Userform question about IF)

    Any takers before it gets thrown to page 2?

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: We play tennis- I keep score (Userform question about IF)

    Hello Sibrulotte ,

    What type of control is "Pointsform.Boxandre1" ?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  7. #7
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: We play tennis- I keep score (Userform question about IF)

    It's a box that states if a player was present.
    I list all possible players (I could use 2 comboboxs instead of ticking who was present).

    So team 1 was comprised of : check box of players present
    team 2 was comprised of: check box of player present (boxandre2, and so forth)


    In sheets "résultats" I'll have points for and points against ("score2" if player was in team 1, or "Score1" if player was in team 2).

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: We play tennis- I keep score (Userform question about IF)

    Hello Sibrulotte,

    Try this out and let me know if you need any changes.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: We play tennis- I keep score (Userform question about IF)

    Good look on this:

    Please Login or Register  to view this content.
    to get names without typing.

    But the whole coding as suggested returns on 1 row:
    the calendar date, the first name on the list, score1, score2
    And then all the following rows have somebody's name in colomne B.

    So not a success right now.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: We play tennis- I keep score (Userform question about IF)

    Hello Sibrulotte,

    That's why is nice to have the workbook whenever possible. Try this change. This should be more what you are looking for.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: We play tennis- I keep score (Userform question about IF)

    We're getting there.
    look at the first post, it contains the xlsm file.

    Last post you did brought back:
    calendar1, "xandr", Score1, Score2
    calendar1, "xsimo", Score1, Score2

    And so forth for all checkboxes.


    I'm only strggling with empty rows here. I've tried with comboboxes instead and it's the same thing:

    My last if statement looks for an empty row, but it's as if the if statement before had not populated the last empty row, so the whole sub sees only 1 emptyrow, the first one that was available when the first if statement started.

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: We play tennis- I keep score (Userform question about IF)

    Hello Sibrulotte,

    I made some changes to the UserForm. I removed the Labels and added the names to each CheckBox. Here is the current code for the button. The attached workbook has all the changes made.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: Userform question about IF

    Wow that does great. I just need to add an if to set team2's "opponent" score, or the score agains to be score1, and their core to be score2.

    Now team 2 has the same score as team1.

    Thanks a bun. I'll try to drill through to understand the logic behind the coding. very usefull

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Userform question about IF

    Hello Sibrulotte,

    I noticed that yesterday but didn't say anything. It is easier to handle the problems one at a time. We still have to make the the players name selection exclusive. Do you want me to work on that while you work on the scores or should I do both?

  15. #15
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: Userform question about IF

    I tried to add an if Name (Ctrl) = "*1"
    to check for theam 1.
    that doesn't work it seems.


    Please Login or Register  to view this content.

    It said number of arguments incorrect or invalid property.
    (it's in french, I'm not 100% sure how to translate)

  16. #16
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: Userform question about IF

    Everytime I come on here, I get the most amazing help. Remember, this is tennis scores. I'm on work hours, and I shouldn't even be doing this.

    it's good knowledge to apply afterwards, but it's still tennis scores...

  17. #17
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: Userform question about IF w/outputs on multiple lines

    I'm still stuck. I don'T know what object to use to check for the checkbox name having a 1 or a 2 in it.

  18. #18
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Userform question about IF w/outputs on multiple lines

    Do you mean the name that the checkbox displays on your userform? If so, try with:

    Please Login or Register  to view this content.
    If you have more than one checkbox change the 1 (in red) accordingly. I hope that works.
    Last edited by Pichingualas; 03-23-2012 at 03:14 PM. Reason: forgot to put the 1 in red lol
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  19. #19
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Userform question about IF w/outputs on multiple lines

    Hello Sibrulotte,

    I ditched the Check Boxes and replaced them all with 2 List Boxes. These are linked to a new sheet "Joueurs" with a dynamic Named Range "Nom". This shortens the code and allows you flexibility when adding or removing names. Here is the User Form code for the new version of the workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    07-27-2009
    Location
    montreal, canada
    MS-Off Ver
    Excel 2003
    Posts
    230

    Re: Userform question about IF w/outputs on multiple lines

    Only one player can partake in the score, we play doubles

    Ah, I'll probably just keep the version where I select lastrow, and do +1, +2, +3 to combobox, even if this leaves blanks, I'll live with it, we almost never play singles anyways.

+ 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