Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I build a Find function into my spreadsheet without a button?


I was looking to see if its possible to build a find function into my
spreadsheet.

What I want it to do is if I type something in A1, I want it to only
show the rows include cells that have that in it. For example if I
typed in Basketball, I want it to search *Product* throughout the
worksheet and only show the rows that have that in it.

I was hoping to do it without a button, so i just click off of the cell
and it does the search. If I type back in the cell and click off of it
it does it again.

I was able to do it with a button and autofilters, making A1 equal the
criteria, but I wanted to know if it was possible just to type
something in and click off and it searches. The code below is what I
have now, but it only works if I assign that code to a button. If I
can get the code below to work without having to click a button and
just click off of the cell, that would be fine too.

Thanks,

~J

Dim Entry As String
Entry = "*" & Range("A1") & "*"
Range("A2").Select
Rows("3:3").Select
Selection.AutoFilter
Range("A3").Select
Selection.AutoFilter Field:=1, Criteria1:=Entry, Operator:=xlAnd


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=574376

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Can I build a Find function into my spreadsheet without a button?

right click the worksheet tab that your data is in. Select View Code,
Select "Worksheet" in the Left ComboBox and "Change" in the Right
ComboBox
This sub should appear:
Private Sub Worksheet_Change(ByVal Target As Range)

End Sub

Add this line of code followed by your code
If Target.Address < Range("A1").Address Then Exit Sub

HTH

Charles


nbaj2k wrote:
I was looking to see if its possible to build a find function into my
spreadsheet.

What I want it to do is if I type something in A1, I want it to only
show the rows include cells that have that in it. For example if I
typed in Basketball, I want it to search *Product* throughout the
worksheet and only show the rows that have that in it.

I was hoping to do it without a button, so i just click off of the cell
and it does the search. If I type back in the cell and click off of it
it does it again.

I was able to do it with a button and autofilters, making A1 equal the
criteria, but I wanted to know if it was possible just to type
something in and click off and it searches. The code below is what I
have now, but it only works if I assign that code to a button. If I
can get the code below to work without having to click a button and
just click off of the cell, that would be fine too.

Thanks,

~J

Dim Entry As String
Entry = "*" & Range("A1") & "*"
Range("A2").Select
Rows("3:3").Select
Selection.AutoFilter
Range("A3").Select
Selection.AutoFilter Field:=1, Criteria1:=Entry, Operator:=xlAnd


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=574376


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
I need to find someone to build a spreadsheet. jackel09 Excel Worksheet Functions 2 November 2nd 09 01:19 PM
how do i build user defined toolbar and custom button in xl07 velvetlady New Users to Excel 6 December 16th 08 12:31 AM
Getting an ActiveX command button to do a spreadsheet function Givvie Excel Worksheet Functions 4 August 28th 07 11:18 AM
Excel function button in spreadsheet Thinkpad21 Excel Discussion (Misc queries) 2 April 25th 06 07:33 PM
Excel function button in spreadsheet Thinkpad21 Links and Linking in Excel 1 April 25th 06 07:33 PM


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