Results 1 to 10 of 10

Thread: Drop down menu (Excel) please help...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    185

    Drop down menu (Excel) please help...

    Dear Experts,

    I am trying to make a drop down menu in Microsoft Excel 2003 using VBA as the following sample:

    I create a drop down menu in B3...and has the following value: "01", "02" and "03"......what should I put the code in order to do like this:

    If I select "02" it will appear automatically "pencil" on the C3....???

    I attached my file for your review...if you need it...

    Thanks a lot for your kind helps..

    Jennifer
    Attached Files Attached Files

  2. #2
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    Re: Drop down menu (Excel) please help...

    How about this?
    Attached Files Attached Files

  3. #3
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Drop down menu (Excel) please help...

    You don't need to use VBA to achieve this. You could use in-cell validation on Cell B2 and then pass the selected value to a lookup fuction to return the propper value. Here's an example.
    Attached Files Attached Files
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    185

    Re: Drop down menu (Excel) please help...

    Hi,

    To "DKenny": Thanks for your reply...it was amazing...But, how to make "step by step" walktrough for in-cell validation on Cell B2 and then pass the selected value to a lookup fuction to return the propper value please..??? Because I could not saw behind its codes....

    To "thelocaluk": Thanks for your reply...it was great and amazing...But, why when I saved it as "Save As Webpage"...It could not interactive anymore..???..it could not select the drop down menu...it look like a death spread sheet...

    Thanks for your kind helps....

  5. #5
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    Re: Drop down menu (Excel) please help...

    I couldn't answer that as I'm a newbie myself, but maybe Dkenny will now?

  6. #6
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Drop down menu (Excel) please help...

    Quote Originally Posted by zach007
    To "DKenny": Thanks for your reply...it was amazing...But, how to make "step by step" walktrough for in-cell validation on Cell B2 and then pass the selected value to a lookup fuction to return the propper value please..??? Because I could not saw behind its codes....
    Steps to Implement in-cell validation with a resulting lookup

    1/ Create a 2 column lookup table with your dataset. Lets assume its in cells F10:G15.
    2/ Select the cell where you want the drop-down.
    3/ Goto the Data==>Validation menu.
    4/ Select "List" in the Allow dropdown.
    5/ Check the "In-cell dropdown" option
    6/ Make the source the first column of your lookup column.
    7/ Click OK.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  7. #7
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    Re: Drop down menu (Excel) please help...

    How do you do this in VB.net???? I am creating the excel file, but need to add a dropdown list for a cell??

    thanks.

  8. #8
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    Re: Drop down menu (Excel) please help...

    See the attached example of how it works, you just need to select the cells you want the drop box then under "Data" select data validation and choose "List" in the allow box.
    Attached Files Attached Files

  9. #9
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Drop down menu (Excel) please help...

    Debbie, please show the code that you are using to create the excel file in vb.net. I will develop the code on that and give it to you.

    Sid
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Drop down menu (Excel) please help...

    try recording macros in excel, then convert the generated code to .net
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width