Add items to a combo box and make them available after closing the sheet

D

DavidCotton

Alright, I have a user form that I have been building and it has the
following code within..

Private Sub UserForm_Initialize()
cboName.Value = ""
cboTestNumber.Value = ""
txtScore.Value = ""

With cboTestNumber
.AddItem "Sec+"
.AddItem "270"
.AddItem "290"
.AddItem "291"
.AddItem "293"
.AddItem "294"
.AddItem "298"
.AddItem "299"
End With

cboName.SetFocus

End Sub




Works great.. At least as far as the cboTestNumber since they are
defined with .AddItem. In another sub I have the following lines
that obviously takes the value from the form and adds it to the combo
box.

With cboName
..AddItem cboName.Value
End With

This also works like a treat and dynamically adds values to the 'Name'
combo box as they are entered so they do not have to be re-typed
later.. BUT if I save the sheet, close out and open again (or reset
the Macro) obviously the value in cboName.Value goes away and my combo
box is once again empty...

What I would like to happen is once a name is entered in the first
time, that the name be added to the 'Name' combo box list and be
available when pulling up the sheet the next day.

Is this possible?

Thanks in advance...

David
 
D

Dave Peterson

Maybe you can store the values on a hidden worksheet and then populate from
there???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top