Can I overtype a listbox item

J

John

I have a listbox in which I use .AddItem to present the user w/ several
choices, from which he can select one. Is it possible to allow him to over
type the first item in the box so that he could supple thy text if he didn't
like the options I presented?

I appreciate your help, -John
 
S

Stringer

John;218336 said:
I have a listbox in which I use .AddItem to present the user w/ severa
choices, from which he can select one. Is it possible to allow him t
ove
type the first item in the box so that he could supple thy text if h
didn'
like the options I presented

I appreciate your help, -Joh

I doubt it, with some code you can type new items in a combobox an
then the new item will be added to the combobox list, check out Dav
Peterson's code here, it will of course need some manipulating to fi
your requirements
http://tinyurl.com/bsywl
 
S

Stringer

Here's some added code to reference with if the combobox is from th
controls toolbar and in the worksheet.

Code
-------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "D17"

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Range("E17").Select
End With
End If


ComboBox1.List = _
Worksheets("Customer List").Range("A1") _
.CurrentRegion.Columns("A").Value

End Sub


Private Sub ComboBox1_LostFocus()
Dim Resp As Long
Dim DestCell As Range

If BlkProc = True Then Exit Sub
With Me.ComboBox1
If .Value = "" Then
'do nothing
Else
If .ListIndex = -1 Then
Resp = MsgBox(Prompt:="This is a new Customer Name, " _
& "Do you want to save it? " & .Value, _
Buttons:=vbYesNo)
If Resp = vbYes Then
Worksheets("Customer List").Select
End If
End If
End If
End With

ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Offset(-1, 0).Range("A1").Select

End Sub
 
Top