Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Search or FIND on a userform.

I want to put a SEARCH or a FIND feild on my userform.

Here is what I currently have:

Private Sub CommandButton48_Click()
'MsgBox TextBox86
If TextBox86 < "" Then
Dim found As Range
With Worksheets("Master")
Set found = .UsedRange.Find(TextBox86, LookIn:=xlValues)
If Not found Is Nothing Then
MsgBox TextBox86 & " Found!"
Else
MsgBox TextBox86 & " Not Found!"
End If
End With
Else

MsgBox "Search Criteria was empty..."

End If

End Sub

How do I restuff all of the screen items? do I just reinitialize
everything? will it be on the right record?
Is there a way to get it to look even in hidden rows?
How do I do a find Next/Prev?

Thanks
Phil



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Search or FIND on a userform.

Or (even better yet...)
Is there a simple way to impliment something like SQL using my current
userform or something???



"Phillips" wrote in message
news:EbTwb.230768$9E1.1257207@attbi_s52...
I want to put a SEARCH or a FIND feild on my userform.

Here is what I currently have:

Private Sub CommandButton48_Click()
'MsgBox TextBox86
If TextBox86 < "" Then
Dim found As Range
With Worksheets("Master")
Set found = .UsedRange.Find(TextBox86, LookIn:=xlValues)
If Not found Is Nothing Then
MsgBox TextBox86 & " Found!"
Else
MsgBox TextBox86 & " Not Found!"
End If
End With
Else

MsgBox "Search Criteria was empty..."

End If

End Sub

How do I restuff all of the screen items? do I just reinitialize
everything? will it be on the right record?
Is there a way to get it to look even in hidden rows?
How do I do a find Next/Prev?

Thanks
Phil





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Search or FIND on a userform.

Adding "SearchDirection" and "After" to the Find method
will help. For this the found cell needs to be
selected...actually not quite true, but with the code as
is...

Private Sub CommandButton48_Click()
'MsgBox TextBox86
If TextBox86 < "" Then
Dim found As Range
With Worksheets("Master").Cells
If found Is Nothing Then Set found = Selection
Set found = .Find(TextBox86, after:=found,
LookIn:=xlValues, searchdirection:=xlNext)

If Not found Is Nothing Then
MsgBox TextBox86 & " Found!" & found.Address
found.Select
Else
MsgBox TextBox86 & " Not Found!"
End If
End With
Else

MsgBox "Search Criteria was empty..."

End If

End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I want to put a SEARCH or a FIND feild on my userform.

Here is what I currently have:

Private Sub CommandButton48_Click()
'MsgBox TextBox86
If TextBox86 < "" Then
Dim found As Range
With Worksheets("Master")
Set found = .UsedRange.Find(TextBox86,

LookIn:=xlValues)
If Not found Is Nothing Then
MsgBox TextBox86 & " Found!"
Else
MsgBox TextBox86 & " Not Found!"
End If
End With
Else

MsgBox "Search Criteria was empty..."

End If

End Sub

How do I restuff all of the screen items? do I just

reinitialize
everything? will it be on the right record?
Is there a way to get it to look even in hidden rows?
How do I do a find Next/Prev?

Thanks
Phil



.

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
Find record by multi criteria in userform MP Excel Discussion (Misc queries) 0 November 3rd 08 04:01 PM
IF with Search/Find??? TotallyConfused Excel Worksheet Functions 5 August 1st 08 10:05 AM
Can Search find 2 or more "/"? Wind54Surfer Excel Discussion (Misc queries) 2 February 22nd 05 04:31 PM
Search and find Rick K Excel Programming 1 August 21st 03 04:15 AM
How can I find a handle number of controls on Userform? sjoo Excel Programming 1 August 4th 03 10:21 AM


All times are GMT +1. The time now is 10:22 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"