+ Reply to Thread
Results 1 to 20 of 20

Drop list with macro and some data

  1. #1
    Registered User
    Join Date
    10-16-2007
    Posts
    24

    Drop list with macro and some data

    Hi,

    I am having some difficulties in making this template for my boss so can someone please give me a hand on this?

    This is the situation:

    I need to create a drop list and when I select the drop list, it will give me a few selections for example: Sports, News, Music. (This I can do). On the right side of the cell, i will have week 1, week 2 all the way to 25.

    Once I select Sports, the data from the Sports section will appear in the next few cells such as basketball, baseball, tennis and so on along with the data in week 1, 2, ... etc There will be an empty cell right below the row of the drop list cell that will allow me to input a new type of sport as well as add data to the week 1, 2, columns.

    Once it has been added, this new sport will be saved under the Sports section.

    I hope this is clear enough!

  2. #2
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    Can you post the workbook? Partly because I don't know how to make a macro launch via a drop down list. Can you explain this to me? Sorry, I have just never done that before. I will try to help you with your problem too, haha.

  3. #3
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    I responded in the New Users forum as you posted it in two different places

  4. #4
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    Okok. This is just an example given the fact that I cannot provide you with the real data (work related).

    The weeks on the right hand side allow the user to input the number of hours for each category. For example: Select sports from the list --> Will make a new row to allow me to insert a new sport (say Rugby) --> Then I can input the number of hours I have played for Rugby. Rugby will then be saved under the sports section along with other sports.

    Hope this helps.
    Attached Images Attached Images

  5. #5
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    The JPEGs didn't come out very well, I can't view them clearly enough to see them. How do you get the macros to launch from selecting an option from the drop down menu?

  6. #6
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    Oh sorry. I haven't! That is why I'm asking. I have only done the basics which is doing the simple drop down list (using the validation function and the data from the 2nd worksheet). I'm hoping someone can figure out the macro part that will pull down the rest of the sports section (example) once I click on sports and as well as allow me to add a new line to input a new sport.
    Last edited by cw1628; 10-17-2007 at 11:43 AM.

  7. #7
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280

    Take a look at this

    You may be able to do what you want by taking a look at this site on Dependent Dropdown Lists


    http://www.contextures.com/xlDataVal02.html

    I think this may be what you want.

    Dean

  8. #8
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    hmm. I've seen this before but I'm not sure that I can apply it or not. I will give it a 2nd try.

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if this link helps

    http://www.excelforum.com/showthread.php?t=605311

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  10. #10
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    Hmm I get where you're coming from but it's not quite what I'm looking for.
    Lets use the Validation example that you supported. If I were to choose Football in the drop down list from cell H1. Then Premiership and C'ship would have appearred in cell H3, and H4. Cell H2 would be a blank row that will allow me to input a new item associated with Football.

    So what I need to do right now is once Football is selected, premiership and c'ship would automatically show up on those 2 cells.

    Does that clear things up?

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you post an example workbook, your jpegs are too blurred to see what you are aiming for.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  12. #12
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    Once again, I haven't done an awful lot. This is just the template of what I would like it to be.

    So once sports is selected. All the sports in that category will be listed at the bottom (where I have put comments in the file) along with the data in the number of weeks (bare in mind that I have not made a table in the other sheet). So for example. when the list of sports have appeared. Basketball will have 5 in week 1 and 3 in week 2..
    While baseball will hve 4 in week 1 and 0 in week 2.
    This is not real and is not shown in my workbook but i'm just showing you what kind of end product I am looking for

  13. #13
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I can only give you guidance without some example to work with. I would make the selection from the Data validation list, which would in turn populate the other cells using VLOOKUP. So you would need a table on another sheet for the VLOOKUPS to work from.

  14. #14
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    I will give that a try but if you can provide just a simple example it would be greatly appreciated.

  15. #15
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    I dont think I ever uploaded the example file. I thought I did. Would you be able to show me what you mean with the Vlookup? Thanks
    Attached Files Attached Files

  16. #16
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if this helps

    VBA Noob
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    GREAT!! It works! Thanks so much.
    Looking at the example file again, I want to be able to add a new sport into the "example" worksheet and not in to the "data" worksheet. I want to add soccer into the sports list without going to teh data worksheet to add. So when I switch to the music selection and switch back to the sports selection, it would show soccer in the sports list. Does that make sense?
    Last edited by cw1628; 10-22-2007 at 11:59 AM.

  18. #18
    Registered User
    Join Date
    10-16-2007
    Posts
    24
    hmm anyone out there that knows what to do?
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    10-16-2007
    Posts
    24

    Drop list that will populate cells

    Hi,

    I have a drop list that I've created and this is what I want it to do.

    A drop list on C3 with options such as Sports, News, Music. If Sports is chosen from the drop list, then starting on D4, it will show all the sub categories from the sports option (such as basketball, baseball, tennis etc).

    If I choose the 2nd option News, then all the sub categories from the News option will show on cell D.... (wherever the sports sub categories end).

    I also have a table on the next worksheet where I gave it a name to make the drop list, as well as the names of each of the subcategories. Now what I am also looking for is, if I want to insert a new sub category for one of the options it will show up in my other worksheet so when I click on that option, that new subcategory will show on the sheet. I think a macro will be needed. Can anyone teach me how to do this? thanks

  20. #20
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Can you post your file to the site? It may help in getting you the answer you seek.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

+ 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