Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
Depending upon the class of your object, there should be a property like RowCount or something like that. Use a "for" loop to loop through the rows, checking that column on each row. As you loop, keep track of a RowNumber and increment that row number on each time through the loop. when you find the desired row, "break" out of your loop before you increment your RowNumber. You now have your row. Most table objects then have some sort of "cell" property that you can then specify by row and column to interact with cells within the table. With your row number found and the desired column (in this case, Column 3 since most tables are based upon a zero based numbering), you should have your cell you're looking for. Something like this in JScript:
Very rough code, not tested, but hopefully this demonstrates the principle.
function ClickOnMyCell()
{
var RowNumber = 1;
var LoopIndex
for(LoopIndex = 1; LoopIndex <= Aliases.MyApp.MyTable.RowCount; LoopIndex++)
{
if Aliases.MyApp.MyTable.Cells(LoopIndex, 3).value = "kk"
{break}
RowNumber++;
}
Aliases.MyApp.MyTable.Cells(RowNumber, 3).Click();
}
Very rough code, not tested, but hopefully this demonstrates the principle.