1

I have the following issue:

I create a userform in excel 2013 and add for starters one text box to show the date and right underneath a combobox which is reflecting a data validation list.

As soon as i write the code

Private Sub UserForm_Initialize() Me.tbDate = Date 'fill combobox For Each cell In [cartridges] Me.cmbCartridges.AddItem cell Next cell End Sub 

Can anyone help pretty please?

Thanks in advance

1 Answer 1

1

The code should work. I am running Excel 2013 as well and just tested your code with no problems.

Two things to check.

1

Make sure that the defined name is spelled exactly the same way in the VBA code as it is in the Name Manger.

2

Make sure that the defined name does not evaluate to an error.

Sign up to request clarification or add additional context in comments.

3 Comments

Super thanks buddy but i double check everything name wise no problem at all. As for the 2 point you made i didnt really get what do i have to check,,,, Thanks again
OK. Regarding item number 2, can you go to the worksheet and select a small range of cells, for example: Z10:Z15 (this could be any blank range) and then once that range is selected, enter: =cartridges and then confirm array-style with Control-Shift-Enter. Does it work or do you get errors?
OK. Here is a quicker way to add the list (no looping through the cells): v = [cartridges]: cmbCartridges.List = v By the way, can you accept the answer?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.