Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
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
The best way to create a Keyword Seach field in excel thallingdvss Excel Worksheet Functions 1 September 28th 09 08:50 PM
how to take data from 2 or 3 wksts and condese it on 1? bri Excel Discussion (Misc queries) 3 February 18th 09 07:43 PM
create a report and have a search funtion to find data JJ Excel Discussion (Misc queries) 1 September 20th 08 03:34 PM
Wkst2 w/all ABSdata computed from wkst1-can't "Find" data pt in#2 wirecup Excel Discussion (Misc queries) 0 August 17th 06 08:37 PM
Wkst2 w/all ABSdata computed from wkst1-can't "Find" data pt in#2 Dave F Excel Discussion (Misc queries) 0 August 17th 06 08:36 PM


All times are GMT +1. The time now is 11:59 AM.

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"