Create ComboBox in Excel cells with VBA (not with UserForm)

0

I have a question, I'm a bit of a rookie with Visual Basic for Excel but I've done something, but now I have a question.

First I want to create a Select or Drop-down List or ComboBox (as you want to call it) but I do not want to do it with UserForm because it displays a window on the cells and I want it in the cells. Example (See image)

Because I think I need it to be visual basic because what I want is for example when selecting DOG in the cell there is not the word dog but a 1, or if it is CAT strong> make it number 2, VACA number 3.

I make myself understood?

I hope you can help me

Thank you very much

    
asked by Juan Fernandez 10.02.2018 в 02:08
source

2 answers

0

this was the answer that arrives to solve:

First, on a sheet, create the data list in a column and the number in front of it (the number is only reference): (See image)

Then from DEVELOPER / INSERT / FORM CONTROLS I insert a ComboBox and right click on it, I select CONTROL FORMAT and I assign it the list of articles and then with which cell I want to link it, in this way when selecting an article, in the linked cell the position of that element is shown in the list in the selected cell. Asi: (See image)

I hope this helps someone else. Good luck!

    
answered by 26.02.2018 / 00:44
source
0

The feature you are looking to apply to the cell is called data validation .

    
answered by 11.02.2018 в 04:49