Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
LISAWATKIN
 
Posts: n/a
Default can i select from list by typing first letter of word?

I HAVE VERY LONG LISTS OF VEHICLES/CUSTOMERS ETC, IS THERE ANY WAY THAT I CAN
KEY IN THE FIRST LETTER OF WHAT I WANT AND THE LIST MOVES DOWN TO THAT
SECTION?
  #2   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

Yes, but you don't need to yell (use of all caps is yelling).
You need a Worksheet_Change event macro and a regular macro to accomplish
this.
You can have a cell into which you type the first letter of the section you
want. Hit Enter and the screen will immediately jump to put the first cell
of that section at the top left corner of the screen.
The macros look like this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Address(0, 0) = "B1" Then Call ShiftList(Range("B1").Value)
End Sub

Sub ShiftList(sLetter As String)
Dim MyRng As Range
Dim SearchFor As String
Set MyRng = Range("A2", Range("A" & Rows.Count).End(xlUp))
SearchFor = sLetter & "*"
On Error Resume Next
MyRng.Find(What:=SearchFor, After:=MyRng(MyRng.Count), _
LookAt:=xlWhole).Activate
If Err < 0 Then
MsgBox "The letter '" & sLetter & "' cannot be found."
Err.Clear
Exit Sub
End If
On Error GoTo 0
With ActiveWindow
.ScrollRow = ActiveCell.Row
.ScrollColumn = 1
End With
End Sub

The first macro needs to be placed in a sheet module for the sheet that
holds all your data. The second macro goes into a regular module.
In the event that the letter you typed cannot be found, a message box will
pop up telling you so.
I assumed that B1 is the cell into which you enter the letter you want. I
also assumed your data is in Column A starting in A2 and going down.
If you send me a valid email address I will send you a small file that has
these macros placed in the proper modules.
My email address is . Remove "nop" from this address.
HTH Otto
"LISAWATKIN" wrote in message
...
I HAVE VERY LONG LISTS OF VEHICLES/CUSTOMERS ETC, IS THERE ANY WAY THAT I
CAN
KEY IN THE FIRST LETTER OF WHAT I WANT AND THE LIST MOVES DOWN TO THAT
SECTION?



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
Extracting/look up data from a list and select multiple instances Candice H. Excel Worksheet Functions 4 April 29th 05 04:38 PM
how to make excel select todays date from a list sococr Excel Worksheet Functions 1 February 27th 05 07:02 PM
select drop down list 1 value will change the value in dr... Vincent Excel Worksheet Functions 1 February 3rd 05 11:52 AM
Pivot Tables, can I use an external list to select data items? Brian Lofquist Excel Worksheet Functions 0 January 4th 05 06:43 PM
select from a fragmented list AndrewB Excel Worksheet Functions 6 December 2nd 04 11:25 PM


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