Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Want to create a search gui on wkst1 to seach data on other wksts
I'm pretty sure if I was a VB developer this would be easy, but unfortunately
I'm not -- so any help would be appreciated. I'd like to build a search gui on the first worksheet of a spreadsheet containing only a text box for the user to type in the search string and a pushbutton to submit. The data can be on any number of other worksheets within the spreadsheet. I'd like to jump to the wkst to show the row of data found with the matching text, then I guess the user can do findnext to continue searching if needed. Thanks, Terri |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Want to create a search gui on wkst1 to seach data on other wksts
Terri,
Here is some code. A couple of observations. It will search from the first sheet forward. As you say, Find can be used to find any others on that sheet, but not on another sheet, so you will need to run the second macro to continue Private ans Sub FindString() Dim sh As Worksheet Dim oCell As Range ans = InputBox("Input search string") For Each sh In ActiveWorkbook On Error Resume Next Set oCell = sh.Cells.Find(ans) On Error GoTo 0 If Not oCell Is Nothing Then sh.Activate oCell.Select End If Next sh End Sub Sub FindNextString() Dim sh As Worksheet Dim oCell As Range Dim i As Long For i = ActiveSheet.Index + 1 To Worksheets.Count On Error Resume Next Set oCell = sh.Cells.Find(ans) On Error GoTo 0 If Not oCell Is Nothing Then sh.Activate oCell.Select End If Next i End Sub -- HTH RP (remove nothere from the email address if mailing direct) "T. Londrigan" <T. wrote in message ... I'm pretty sure if I was a VB developer this would be easy, but unfortunately I'm not -- so any help would be appreciated. I'd like to build a search gui on the first worksheet of a spreadsheet containing only a text box for the user to type in the search string and a pushbutton to submit. The data can be on any number of other worksheets within the spreadsheet. I'd like to jump to the wkst to show the row of data found with the matching text, then I guess the user can do findnext to continue searching if needed. Thanks, Terri |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The best way to create a Keyword Seach field in excel | Excel Worksheet Functions | |||
how to take data from 2 or 3 wksts and condese it on 1? | Excel Discussion (Misc queries) | |||
create a report and have a search funtion to find data | Excel Discussion (Misc queries) | |||
Wkst2 w/all ABSdata computed from wkst1-can't "Find" data pt in#2 | Excel Discussion (Misc queries) | |||
Wkst2 w/all ABSdata computed from wkst1-can't "Find" data pt in#2 | Excel Discussion (Misc queries) |