Search box for text

  • Thread starter Thread starter Allan Grates
  • Start date Start date
A

Allan Grates

I'm looking for a solution for an item search box for an inventory. I have a
spreadsheet that I need to find "Name of product" and scroll it up to the
bottom of my frozen pane. I've searched the discussions forum and tried
several formulas, non have worked for me.
In my frozen panes view, I'm looking to have a search box to type an item
name in and have excel scroll it up to the bottom of the frozen pane. The
item names are in column "D".
Any takers?????
Thanks, Allan Grates
 
You are not going to be able to do this with formulas since formulas cannot
take any actions (such as scrolling the worksheet), you will need VB for
this. Here is a macro to attach to the button I assume you will have to let
the user be able to signal that they are done typing...

Sub FindAndScrollToItem()
Dim ItemToFind As String
ItemToFind = "Name of product"
ActiveWindow.ScrollRow = Columns("D").Find(ItemToFind, _
After:=Cells(Rows.Count, "D"), _
LookAt:=xlWhole, SearchDirection:=xlNext, _
MatchCase:=False).Row
End Sub
 
Of course, you should replace this line...

ItemToFind = "Name of product"

with one that pulls the text out of your TextBox. If you tell us where you
got the TextBox from (either the Controls Toolbox toolbar or the Drawing
toolbar) and what the name of the TextBox is, then we could give you the
actual line of code to use.
 
Back
Top