View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
John G.[_2_] John G.[_2_] is offline
external usenet poster
 
Posts: 34
Default Getting input from combobox to update sheet


Thanks Jacob and James for the suggestions and advice...I'll let you when I
get it working.

"John G." wrote:

In a userform I'm have a Combobox (CB) that holds names. When the routine is
first run list for the CB is empty. The user then inputs a name and this is
to be stored for subsequent uses of the workbook. Any other time the form is
opened, the ListIndex = 0 will show the user's name for confirmation.

The following is another option that I'm contemplating but I need to get the
single entry done first: "If another user needs to, they can input their
name and it is then added to the top of the list, so that the next time the
form is opened this new entry will be the default name shown on the form and
the previous entries would show in the dropdown as secondary names."

It is my understanding that manual input into a combobox can be stored back
to a sheet, preferably the list for the combobox.

Can't seem to find a way to start this that works. I tried using CB_Exit to
allow for input but it doesn't copy the input back to the named range on the
sheet. Also, I don't seem to getting the new entry into the value property
after it's typed in.

--------------------------------------------------
' CBName is the combobox and Cardholder is the named range

Private Sub CBName_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim CHName As String
CHName = Sheets("Carddata").Range("Cardholder").Cells(1, 1).Value
If CHName = "" Then
CHName = Me.CBName.Value
End If
End Sub
----------------------------------------------------