+ Reply to Thread
Results 1 to 11 of 11

creating a chart from a userform

  1. #1
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    creating a chart from a userform

    I have a dynamic table on a worksheet that shows in

    col A name of player
    col B Date
    Col C Course
    Col D Course Par
    Cols E-V individual hole scores

    what I am wanting to do is create a userform which uses drop down boxes to select the player and the course an option button to select a hole and when command button is clicked produces a chart showing date and scores for selected hole. This could be in another worksheet or the origional userform or a new userform. Would this be possible?
    james
    Attached Files Attached Files

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: creating a chart from a userform

    You don't need a userform for this.

    You can use a worksheet.
    See attached.
    On Sheet2 cells B1:B3 use different drop down lists to select player, course and hole.

    A macro is assigned to a command button. Drop down selections are passed as filter criteria for filtering the data table on Sheet1.
    Dates and scores from the matching hole are copied to Sheet2.

    Lists were set up on sheet3 and are used in the DV drop down.

    On Sheet1, I suggest you use drop down selections for players and courses to avoid issues with typographical errors that can cause the code to fail.

    This is basic code, not much error handling beyond testing for blanks in the drop downs.

    Please Login or Register  to view this content.
    Excel Help _807056.xlsm
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: creating a chart from a userform

    Thanks this is Great

    I wondered if your code could be adapted to work in a userform
    You have shown me that check boxes are not needed for the holes unless multiple hole analysis is required so a combobox is all that is needed
    thanks again for your help
    James

  4. #4
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: creating a chart from a userform

    So thinking outload and for the benefit of anyone else looking for a similar solution
    I would need to create a dynamic table which cleared itself and repopulated with new data from a userform and then showed the chart in a worksheet or new userform that popped up on clicking a "create Chart" button

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: creating a chart from a userform

    A user form is not a requirement and, IMO, not needed. It is simpler to go with populating cells in a worksheet.

    However, if you intend to allow multiple holes to be selected then you would need a different approach for hole selection(s). Data validation allows only one selection.

  6. #6
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: creating a chart from a userform

    Ok

    I have started to put your work into my master work book and have staight away come up against a problem

    I am going to use your method of bringing up a chart but cannot for the life in me work out how you populated the "hole" dropdown box

    I have attached workbook for you to look at

    can you point me in a general direction

    I have populated the name and course boxes using the source in the properties
    have I completely missed or am i a little bit on target
    James

    P.S What does IMO mean
    Jamesgolf handicapper v1.1.2.2 forum copy.xlsm

  7. #7
    Forum Contributor ianh's Avatar
    Join Date
    11-19-2010
    Location
    Newcastle
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: creating a chart from a userform

    imo= in my opinion
    2+2=5 for extremely large values of 2.

  8. #8
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: creating a chart from a userform

    Thanks ian
    Couldn't work it out at all

  9. #9
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: creating a chart from a userform

    I would use Data Validation drop down list - not the combo box controls. This is what I modeled the code on. It will require significant changes to adapt to using controls.
    The drop down list for the holes was set by create a named range referring to the range of cells E1:V1 on sheet1 of the example file.

    Since these are fixed values that will not change, you could just type the list in to the list source for the Data Validation.

  10. #10
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: creating a chart from a userform

    If you want to include any combination of holes, then try using Marlett check boxes

    Modified code below and now includes additional code to use Marlett check boxes in the worksheet selection change event.

    Worksheet code:
    Please Login or Register  to view this content.
    Code modified to use the selections for multiple holes:

    Please Login or Register  to view this content.
    Also, you may want to clear the selection in one go to start fresh.

    Please Login or Register  to view this content.
    Excel Help _807056.xlsm
    Last edited by Palmetto; 01-02-2012 at 01:54 PM. Reason: added "Reset" code and new workbook

  11. #11
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: creating a chart from a userform

    Fan Tast Ic !!!!!

    Thank you This will help even more that the first solution and I have a 9 hour flight to figure it all out on friday

    Brill thanks Palmetto

+ 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