LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combo box will not save text typed


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

--
antr
-----------------------------------------------------------------------
antro's Profile: http://www.excelforum.com/member.php...fo&userid=1577
View this thread: http://www.excelforum.com/showthread.php?threadid=27294

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rows expand to fit text typed in? Amy Excel Discussion (Misc queries) 2 July 29th 08 05:52 PM
how do I print Just text I typed on top of a template Rudy Excel Discussion (Misc queries) 1 October 23rd 07 02:03 PM
Change Text Box Color When Typed In Paperback Writer Excel Discussion (Misc queries) 5 December 5th 06 07:41 PM
Inserting characters into text already typed [email protected] Excel Discussion (Misc queries) 2 February 24th 06 02:11 AM
capture text typed in Combo Box seeker Excel Programming 0 May 4th 04 06:14 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"