LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Search Multiple Sheets Then Add Txt1.Txt to Cell

Here is my issue i have been Trying to figure this out for about a
day and a half

Im Trying to Search 3 Sheets
Sheet 1 Is Shelter
Sheet 2 is NonShelter
Sheet 3 is TPR
I need it to Search 3 Sheets column A For the name, Now the Names
will be like this in column A

Hubbard, John
Hubbard, Rick

Etc Etc so It Has to pull up multiple Names Placing them in a
listbox on a different form
any ideas??? Im Really Confused :(\

I'm Still very new to vba so Im sure my coding sucks :)


Private Sub CmdSearch_Click()
Dim sh As Worksheet
Dim rng As Range, firstAddress As String
Dim SearchTxt As String
SearchTxt = TxtCaseName.Text

For Each sh In ThisWorkbook.Worksheets
Set rng = sh.Cells.Find(What:=SearchTxt, After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If Not rng Is Nothing Then
firstAddress = rng.Address
Do
Set rng = sh.Cells.FindNext(rng)
FrmSelection.LboxSelect.AddItem (rng)
Loop Until rng.Address = firstAddress
End If
Next
If FrmSelection.LboxSelect.Value < 1 Then
Unload Me
FCreate.Show
Else
Unload Me
FrmSelection.Show
End If

End Sub

 
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
search, copy and paste through multiple sheets Jeff S.[_2_] Excel Discussion (Misc queries) 1 August 16th 09 12:08 AM
Create a cell that will search multiple sheets for entered string. accesseng Excel Discussion (Misc queries) 0 January 13th 09 02:22 AM
Search in Multiple Sheets [email protected] Excel Discussion (Misc queries) 4 September 12th 07 10:33 PM
search multiple sheets for specific date, return data in cell to r NonIllegitimiCarborundum Excel Discussion (Misc queries) 0 April 28th 06 09:02 PM
Search across multiple sheets and subtotal. Pat Bell Excel Programming 1 December 8th 03 03:16 PM


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"