Avatar of Geekamo
Geekamo
Flag for United States of America asked on

VBA Dropdown List

Hello Experts,

I would like to add a VBA dropdown list in the cell right below "Name".  If the cell to the right (named cell: 'RVStatus') says "Active" then I want the dropdown list to reference named range: EmpActiveAlpha, but if the cell says "In Active" - then I would like the dropdown list to reference named range: EmpInActiveAlpha.

error1.PNG
Thank you in advance for your help!
Microsoft ExcelVB ScriptVBA

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Wayne Taylor (webtubbs)

Why a VBA dropdown? You can do this with a Data Validation list....

1) From the Data tab on the ribbon, select "Data Validation"
2) Allow "list"
3) Enter this formula in Source...
    =IF(RVStatus="Active", EmpActiveAlpha, IF(RVStatus="In Active", EmpInActiveAlpha, ""))
4) Click OK.

Wayne
Geekamo

ASKER
I received an error when I use the data validation. It basically says it resulted in an error. So instead of troubleshooting that, I just asked about VBA knowing it can be done that way too.
Wayne Taylor (webtubbs)

It can be done in VBA, but it's harder to maintain that a DV list.

Can you post a screenshot of the error?
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Rodney Endriga

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Martin Liss

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.