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.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful
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...
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
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.
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