Thread: find
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default find

and it says?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"enyaw" wrote in message
...
Still doesnt seem to work. I added the code to a command button on the
userform. I added an else statement at the end giving a message box if it
didnt work and the message box pops up when i try to run the code.
"Bob Phillips" wrote:

It may be wrap-around

Dim iRow As Long

On Error Resume Next
iRow = ActiveSheet.Evaluate("Match(1, (""" & TextBox1.Text & _
"""=A1:A1000)*(""" & _
TextBox2.Text & """=B1:B1000), 0)")
On Error GoTo 0
If iRow 0 Then
'iRow now points to the matching row in the worksheet


if that doesn't work please supply details of what happens.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"enyaw" wrote in message
...
Bob this code still isnt working for me.

"Bob Phillips" wrote:

Sorry, you are right, that won't work. Here is an alternative (which

should
work)

Dim iRow As Long

On Error Resume Next
iRow = ActiveSheet.Evaluate("Match(1, (""" & TextBox1.Text &
"""=A1:A1000)*(""" & _
TextBox2.Text & """=B1:B1000), 0)")
On Error GoTo 0
If iRow 0 Then
'iRow now points to the matching row in the worksheet

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bob Phillips" wrote in message
...
Use something like this

On Error Resume Next
iRow = Application.Match(1,(TextBox1.Text =

Columns(1))*(TextBox2.Text
=
Columns(2)),0)
On Error Goto 0
If iRow 0 Then
'iRow now points to the matching row in the worksheet

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"enyaw" wrote in message
...
I have a userform with two textboxes on it. I use it to find

and
return
values. How would i code this userform so as if i search the

worksheet
for
both values that it will return the values in that row? I need

the
first
textbox to search through column A and the second textbox to

search
through
column B. Both values must be found in the same row. I then

need
to
return
the values from that row into another form. I have the code to

return
the
values.