Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Enter text in a Combobox

Is it possible to allow a user to enter a "not list" item into a VB userform
combobox?

I found this website saying that there are three types of comboboxes:
http://www.vb6.us/tutorials/visual-b...o-box-tutorial

It says that a type 0 combobox allows a user to enter values in the textbox
portion of the combobox. Is this correct and how do I code the combobox to
allow this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Enter text in a Combobox

You can change the .Style property of the combobox.

Open the VBE
Select your userform
Select the Combobox
Hit F4 to see the properties window

Scroll down to the Style property and choose the one you want.

But you'll only see two styles in VBA. It's different from VB.

=======
In code you could use:
Option Explicit
Private Sub UserForm_Initialize()
Me.ComboBox1.Style = fmStyleDropDownCombo
'or
Me.ComboBox1.Style = fmStyleDropDownList
End Sub

aftamath77 wrote:

Is it possible to allow a user to enter a "not list" item into a VB userform
combobox?

I found this website saying that there are three types of comboboxes:
http://www.vb6.us/tutorials/visual-b...o-box-tutorial

It says that a type 0 combobox allows a user to enter values in the textbox
portion of the combobox. Is this correct and how do I code the combobox to
allow this?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 271
Default Enter text in a Combobox

Hi, I wanted to rebump this question because I had a similar situation. I'm
sort of new to Excel VBA so please bear with me.

I have a combobox that lists client names.
I have it filled via RowSource to a named range (called "CLIENT_NAMES").
I want my users to be able to choose client names from the combobox,
however, if they have a new client, I want them to be able to just type in
the new client's name and have that added to my named range.

Aside from convoluted coding to read the value of the combobox, and then
using if/then statements to add it to my range, is there a more direct,
built-in method that I can do this? Or will I have to do a lot of coding
just to add this feature?

(If so I will just give my users a textbox instead and do my adding on the
excel side rather than the VBA side.)

Thanks in advance!
Susan

"Dave Peterson" wrote:

You can change the .Style property of the combobox.

Open the VBE
Select your userform
Select the Combobox
Hit F4 to see the properties window

Scroll down to the Style property and choose the one you want.

But you'll only see two styles in VBA. It's different from VB.

=======
In code you could use:
Option Explicit
Private Sub UserForm_Initialize()
Me.ComboBox1.Style = fmStyleDropDownCombo
'or
Me.ComboBox1.Style = fmStyleDropDownList
End Sub

aftamath77 wrote:

Is it possible to allow a user to enter a "not list" item into a VB userform
combobox?

I found this website saying that there are three types of comboboxes:
http://www.vb6.us/tutorials/visual-b...o-box-tutorial

It says that a type 0 combobox allows a user to enter values in the textbox
portion of the combobox. Is this correct and how do I code the combobox to
allow this?


--

Dave Peterson

Reply
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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
help on spinbutton controllinng a text or ComboBox showing time [email protected] Excel Discussion (Misc queries) 4 July 29th 07 04:11 AM
combobox text size CraigSA Excel Discussion (Misc queries) 0 May 18th 06 02:46 PM
How do i populate a text box according to selection in combobox? Steve Excel Worksheet Functions 0 April 13th 06 12:40 PM
Select Text Files from Combobox D.Parker Excel Discussion (Misc queries) 4 June 28th 05 03:46 PM


All times are GMT +1. The time now is 09:27 PM.

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

About Us

"It's about Microsoft Excel"