Find method

  • Thread starter Thread starter Andrea
  • Start date Start date
A

Andrea

Hello

Why this simple script:
_______

Function prova()
Dim c As Range
Set c = Worksheets("riepilogo").Range("A1:A20").Find("parola")
If Not c Is Nothing Then
prova = "pluto"
End If
End Function
_______

run in Excel 2002 (VB 6.3) and not in Excel 2000 (VB 6.0) ???

Please help me (answers also in Italian)

Thank you

Andrea
 
Hi andrea
what error did you get. You may try the following
Function prova()
Dim c As Range
on error resume next
Set c = Worksheets("riepilogo").Range("A1:A20").Find("parola")
on error goto 0
If Not c Is Nothing Then
prova = "pluto"
End If
End Function
 
Hi Frank

I resolve the problem ;-)
The script run without error, but the method "find" in Excel 2000 and
earlier don't work in a user defined function (only macro).
You have to use the instruction "match ()".

Thank you anyway

Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top