LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default How Do I Get A ComboBox To Add Entry To It's List If Not In Li

Don't forget to give Tom credit for helping you out.

"Minitman" wrote:

Hey Tom,

Thanks for the tip on the OFFSET I was having problems with it and
couldn't figure out why, And yes there is a header row.

Thanks again for your help, it is appreciated.

-Minitman


On Mon, 3 Oct 2005 17:22:56 -0400, "Tom Ogilvy"
wrote:

If you have something in B1, then this definition

=OFFSET(List!$B$2,0,0,COUNTA(List!$B:$B),1)

will include a blank cell at the end of the range. since you set it up this
way, I assumed B1 was empty. if not, then you need to change the defintion
to
=OFFSET(List!$B$2,0,0,COUNTA(List!$B:$B)-1,1)

or to change the code to:

Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim rng As Range, sVal As String, res As Variant
Set rng = Range(ComboBox1.RowSource)
sVal = ComboBox1.Value
res = Application.Match(sVal, rng, 0)
If IsError(res) Then
' change next line
rng.Offset(rng.Rows.Count-1, 0).Resize(1, 1).Value = _
ComboBox1.Value
ComboBox1.RowSource = ""
ComboBox1.RowSource = "lVendor"
ComboBox1.Value = sVal
End If
End Sub



 
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
LIST ENTRY ENABLE DROP DOWN LIST TO ACCEPT MORE THAN 1 ENTRY Frank Excel Discussion (Misc queries) 2 September 18th 08 10:31 PM
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
How do I set up entry box to auto-alphabatize each entry in list? jhakers Excel Discussion (Misc queries) 0 February 14th 08 08:01 PM
drop down list shows first blank row after last list entry Jerry Bennett[_2_] Excel Discussion (Misc queries) 1 November 10th 07 11:35 AM
Combobox - add manual entry to future list cornishbloke[_23_] Excel Programming 3 January 16th 04 01:19 PM


All times are GMT +1. The time now is 11:56 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"