Jump to content

_Excel_RangeFind use


Recommended Posts

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. 

Link to comment
Share on other sites

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
Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If UBound($aResult, 1) > 0 Then ... ; Find successful

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...