Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found this code to search a Work Sheet. I also need a text box and the code
for this box to work. What am I missing? Sub Find_First() Dim FindString As String Dim rng As Range FindString = InputBox("Enter a Search value") If Trim(FindString) < "" Then With Sheets("Sheet1").Range("A:A") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If End With End If End Sub Thank you for your help! Bob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code works fine as written. What specifically are you trying
to accomplish. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Bob" wrote in message ... I found this code to search a Work Sheet. I also need a text box and the code for this box to work. What am I missing? Sub Find_First() Dim FindString As String Dim rng As Range FindString = InputBox("Enter a Search value") If Trim(FindString) < "" Then With Sheets("Sheet1").Range("A:A") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If End With End If End Sub Thank you for your help! Bob |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a Search box at the top of each sheet in this work book to enter a job
number press enter a goto that number in a column (Job Number) since there are several hundred in that column. "Chip Pearson" wrote: Your code works fine as written. What specifically are you trying to accomplish. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Bob" wrote in message ... I found this code to search a Work Sheet. I also need a text box and the code for this box to work. What am I missing? Sub Find_First() Dim FindString As String Dim rng As Range FindString = InputBox("Enter a Search value") If Trim(FindString) < "" Then With Sheets("Sheet1").Range("A:A") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If End With End If End Sub Thank you for your help! Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Functions (search within search result) reply to this please | Excel Worksheet Functions | |||
Functions (search within search result) | Excel Worksheet Functions | |||
How do I search excel spreadsheets using multiple search criteria. | Excel Worksheet Functions | |||
I cant do a search on this forum. Everytime I search, it comes up with zero results | Excel Programming | |||
Create a search Field within a worksheet to search command buttons | Excel Programming |