Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
combo box will not save text typed
That works but is there a way to make the routine run without tying i to a command button? some type of "on save" statement? antro Wrote: Try looking at the samples in this file: http://theofficeexperts.com/download...rmTraining.zip Here is the code used in the example for adding a value to a combobo that is bound to a worksheet Code ------------------- 'This procedure adds a new item to a ComboBox that is 'bound to a worksheet. Private Sub CommandButton2_Click() Dim SourceData As Range Dim Found As Object Set SourceData = Range("listrange") Set Found = Nothing Set Found = SourceData.Find(ComboBox2.Value) 'If the item is not found in the list... If Found Is Nothing Then '...redefine the name ListRange SourceData.Resize(SourceData.Rows.Count + 1, 1).Name = "ListRange" 'Add the new item to the end of the list on the worksheet SourceData.Offset(SourceData.Rows.Count, 0).Resize(1, 1).Value = ComboBox2.Value 'Reset the list displayed in the ComboBox ComboBox2.RowSource = Range("listrange").Address(external:=True) End If End Sub ------------------- Antr -- john q publi ----------------------------------------------------------------------- john q public's Profile: http://www.excelforum.com/member.php...fo&userid=1578 View this thread: http://www.excelforum.com/showthread.php?threadid=27294 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Rows expand to fit text typed in? | Excel Discussion (Misc queries) | |||
Change Text Box Color When Typed In | Excel Discussion (Misc queries) | |||
combo box will not save text typed | Excel Programming | |||
combo box will not save text typed | Excel Programming | |||
capture text typed in Combo Box | Excel Programming |