• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search Data in A Worksheet

sunilreddyc

New Member
How to Search data entered into Say in Cell A1 and directly pointing the cursor to that data. Similar to Ctrl-F functionality.


Whatever data or string of data user want to search will be inputted in a designated cell say "A1" and excel should automatically search and point towards that data


Is there a function to do that or VBA code is only required to do that


Thank You

Sunil
 
You'd have to use VB. Here's a sample code you could use (right click on sheet tab, view code, paste this in).

[pre]
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'If it's not a cell we care about, do nothing
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub

'Turn off events, so we don't trigger any more macros
Application.EnableEvents = False
'Find the value
Target.Select
Cells.Find(Target.Value, Range("A1")).Activate
Target.ClearContents
Application.EnableEvents = True

End Sub
[/pre]
 
Back
Top