View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
ufo_pilot ufo_pilot is offline
external usenet poster
 
Posts: 142
Default How do I set up a drop down list to beginning letter of item?

Kerri, place any button ( or autoshape ) into your sheet
copy the Sub below
rightclick on the tab of the sheet
paste the sub into the module

Go back to your button or autoshape
right click on it
select Assign Macro ( now this macro will run when the shape is clicked)
choose the one you just pasted in

replace "sheet1" with the name of your current worksheet
replace "FindThis" with the cell you want to match ( your dropdown window
cell)
And replace the "LookHere" with the column you want to look in
You can designate a column (pref col A... insert one if you need to )
type the letter( col A ) at the beginning of your list (in col B)

col A col B

A Adams
Afrin
Agnes
B Bailey
Barnes
Beetle
etc......


HTH


Sub GoFindThis()
Dim myFind As Integer
Dim rng As Range
myFind = Worksheets("sheet1").Range("FindThis").Value
Set rng = Worksheets("sheet1").Range( _
"LookHere").Find(myFind, _
LookIn:=xlValues, LookAt:=xlWhole)
If Not rng Is Nothing Then
Application.GoTo rng, True
Else
MsgBox myFind & " You selection was not found"
End If
End Sub




"Kerri" wrote:

I have created a drop down list in Excel and I want to be able to type the
letter K and it go to those items in the list that begin with K. Does anyone
know how I can set this up?