Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default combo box list shortcut

Hi

I have a combo box on a VBA data entry form. One of the validated lists is
approx 100 names long and is a pain scrolling through. Is it possible to
maybe enter the first letter of the name and bring up only those beginning
with that letter ?
--
thanks
Roy
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default combo box list shortcut

There's a MatchEntry property for the combobox.

Try changing it to fmMatchEntryFirstLetter (either in code or via the properties
window.



Roy Gudgeon wrote:

Hi

I have a combo box on a VBA data entry form. One of the validated lists is
approx 100 names long and is a pain scrolling through. Is it possible to
maybe enter the first letter of the name and bring up only those beginning
with that letter ?
--
thanks
Roy


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default combo box list shortcut

Hi Dave

thanks for prompt reply (as always !)

This suggestion helps but I am finding that it simply finds the first name
in the "t's" for example when I may want the 4th or 10th etc....

Is it possible to type a single letter and have the combo box to display
just names beginning with that letter (eg T) and then allow you to select the
correct name?
--
thanks
Roy


"Dave Peterson" wrote:

There's a MatchEntry property for the combobox.

Try changing it to fmMatchEntryFirstLetter (either in code or via the properties
window.



Roy Gudgeon wrote:

Hi

I have a combo box on a VBA data entry form. One of the validated lists is
approx 100 names long and is a pain scrolling through. Is it possible to
maybe enter the first letter of the name and bring up only those beginning
with that letter ?
--
thanks
Roy


--

Dave Peterson
.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default combo box list shortcut

You may want to try ".MatchEntry = fmMatchEntryComplete". Then you can just
keep typing the entry.

The only way I know to do what you want is to have two comboboxes. One for the
first letter and one that is populated only after that choice is made in the
first combobox.

Something like:

Option Explicit
Private Sub ComboBox1_Change()
Dim myRng As Range
Dim myCell As Range

If Me.ComboBox1.ListIndex < 0 Then
'nothing chosen
Beep
Exit Sub
End If

With Worksheets("Sheet1")
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

With Me.ComboBox2
.Clear
For Each myCell In myRng.Cells
If UCase(Left(myCell.Value, 1)) = UCase(Me.ComboBox1.Value) Then
.AddItem myCell.Value
End If
Next myCell

If .ListCount 0 Then
.Enabled = True
Else
'no matches
.Enabled = False
End If
End With
End Sub
Private Sub UserForm_Initialize()
Dim lCtr As Long
With Me.ComboBox1
For lCtr = Asc("A") To Asc("Z")
.AddItem Chr(lCtr)
Next lCtr
End With

With Me.ComboBox2
.Enabled = False
.MatchEntry = fmMatchEntryComplete
End With
End Sub

Roy Gudgeon wrote:

Hi Dave

thanks for prompt reply (as always !)

This suggestion helps but I am finding that it simply finds the first name
in the "t's" for example when I may want the 4th or 10th etc....

Is it possible to type a single letter and have the combo box to display
just names beginning with that letter (eg T) and then allow you to select the
correct name?
--
thanks
Roy

"Dave Peterson" wrote:

There's a MatchEntry property for the combobox.

Try changing it to fmMatchEntryFirstLetter (either in code or via the properties
window.



Roy Gudgeon wrote:

Hi

I have a combo box on a VBA data entry form. One of the validated lists is
approx 100 names long and is a pain scrolling through. Is it possible to
maybe enter the first letter of the name and bring up only those beginning
with that letter ?
--
thanks
Roy


--

Dave Peterson
.


--

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
Combo box list help Michelle Excel Discussion (Misc queries) 2 January 10th 08 09:26 PM
Keyboard shortcut for List Box B Baggins Excel Worksheet Functions 1 September 20th 07 12:42 PM
Shortcut key for dropdown list? Brcobrem Excel Discussion (Misc queries) 2 February 1st 07 02:49 PM
Combo box or list box famdamly Excel Discussion (Misc queries) 2 January 11th 06 02:58 AM
Combo Box List aftamath Excel Discussion (Misc queries) 2 October 5th 05 08:39 PM


All times are GMT +1. The time now is 04:45 AM.

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"