Rambert

_Excel_RangeFind use

12 posts in this topic

Hi everybody.

I am using function _Excel_RangeFind to look a value at excel file. That file only has one sheet.

There are about 4000 rows and 5 columns.

I need to look for a value in that range A1:A4000 and get the rest of values of that row.

So i am able to find a value that exists at excel file, but if i look for a value that is not in file how can i manage that error.

Resuming if i look for a value in cells range A1:A4000 and it's found, I am able to take the rest of values ( imagine value is found in A130 cell then i can get an array with values in cells A130 B130 C130 D130 E130) but if value is not found in any  cell i need show a msgbox and exit program.

My problem is when value is not found. I can't manage error.

Thanks and regards. 

Share this post


Link to post
Share on other sites



Test one of the examples in helpfile and you see how to do this.

Share this post


Link to post
Share on other sites

I have read four scripts at help but i must be blind cause I can't get it

I will try to read again and if i don't get it, i will post here

thanks

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Nothing...

I have created a test scripts like help scripts number 1

I have changed only string to find ( 37000 to 99999)

I have created a folder named Extras at my folder scripts, and i have copied _Excel1.xls on it.

I have pressed F5 and tell me data has been searched...

but show me an empty array

Could you test it???

thanks and regards

 

Edited by Rambert

Share this post


Link to post
Share on other sites

Tested at this moment

Look my files attached

Captura.PNG

Captura2.PNG

Captura3.PNG

Share this post


Link to post
Share on other sites

i go bed

thanks and regards

Share this post


Link to post
Share on other sites

Not finding a specified string is not regarded to be an error by the function. It always returns the number of found cells in the array. When there are no cells matching the search string then an empty array is being returned.
So check the number of Rows in the array. 0 means: Nothing found.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

How can i chek number of rows???

Share this post


Link to post
Share on other sites
If UBound($aResult, 1) > 0 Then ... ; Find successful

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks. I will check later

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now