ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Search request (https://www.excelbanter.com/excel-discussion-misc-queries/221362-search-request.html)

GregNga

Search request
 
I would like to be able to do a search by pressing a key on the keyboard and
having Excel position to the first cell in the selected column that begins
with the character of the key pressed. Kind of like in Windows Explorer

Does anyone have a macro to do this or is there another way

curlydave

Search request
 
On Feb 17, 5:57*pm, GregNga wrote:
I would like to be able to do a search by pressing a key on the keyboard and
having Excel position to the first cell in the selected column that begins
with the character of the key pressed. Kind of like in Windows Explorer

Does anyone have a macro to do this or is there another way


This would go into the worksheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Dim f As Range
Set f = Range("A2:A65536").Find(Target, LookIn:=xlValues)
If Not f Is Nothing Then
f.Select
End If
End If
End Sub

enter something to look for in A1 and it will select the first value
in column A after A1
It has issues though...
if you enter 1 in A1 and press enter, it will select the first cell in
Column A with a 1 in it.

Maybe you are thinking of an auto fill, like with a ComboBox ? if so
maybe supply some more info...


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com