Clicking the wrong item in the table
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Clicking the wrong item in the table
hello,
i've a dynamic table and item displays based on search criteria. my script is able to find the item in the table but always clicks the first cell when the exact match is not on the first Cell. not sure what i'm doing wrong in the code, code is attached. thanks for your help.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For arrCount=0 To UBound(arrObjects)
If arrObjects(arrCount).contentText=strQtName Then
Set CurrentObj=arrObjects(UBound(arrObjects))
ObjFound=True
Exit For
End If
Next
-----------------------
It looks to me like when your If statement finds your string, you are always setting the CurrentObj to the object at UBound. Should it be more like
Set CurrentObj=arrObjects(arrCount)
because you want the object that just matched your string, right?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right now when you match the string, you are always saving this Set CurrentObj=arrObjects(UBound(arrObjects))
but the string was found at arrObjects(arrCount) so that's the one you want to save in CurrentObj
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think your loop will quit on the first match it finds.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
