casucecle
Joined: 26 Aug 2008 Posts: 1
|
Posted: Tue Aug 26, 2008 10:17 am Post subject: "Out of Range" on a basic function |
|
|
Hi,
I made a function to search through a sheet and give me the row that corresponds to "cherch", but an error appears "Run time error 9" Subscript out of range.
Here is the code
Public Function cherche(fichier, cherch, n, p, feuille) As Integer
While (Workbooks(fichier).Sheets(feuille).Cells(n, p).Value <> cherch) * (n < 1000)
n = n + 1
Wend
cherche = n
End Function
I tried to take the (n < 1000) part off but it does not change anything
Thx for the help |
|