Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


"Out of Range" on a basic function



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Visual Basic Forum
View previous topic :: View next topic  
Author Message
casucecle



Joined: 26 Aug 2008
Posts: 1

PostPosted: Tue Aug 26, 2008 10:17 am    Post subject: "Out of Range" on a basic function Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Visual Basic Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap