|
-
Nov 2nd, 2005, 04:17 PM
#1
Thread Starter
Addicted Member
search with vba
hi im not sure if this goes in this section but here goes
i have done some code to search an excel document using a userform but ive run accross a small problem, the problem being when i click the search button it finds what i require but i would like it to display the contents of the whole row instead of just the item i searched for i have posted my code below if you can help i would be greatful.
VB Code:
If OptionButton1.Value = True Then
With Worksheets(1).Range("A3:E65536")
Set c = .Find(TextBox1.Text, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
MsgBox "This Staff Number Belongs To:", vbOKOnly, "Staff Number Found"
Else
MsgBox "No Such Staff Number", vbOKOnly, "Staff Number Not Found"
End If
End With
End If
-
Nov 2nd, 2005, 05:33 PM
#2
Re: search with vba
Try something like this:
VB Code:
For iCount = 1 To 5
sOut = sOut & c.Cells(1, iCount).Value & ","
Next iCount
-
Nov 2nd, 2005, 06:51 PM
#3
Re: search with vba
Moved to Office Development.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|