Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Max value in webtable

1. ## Max value in webtable

Can any one tell me the logic to find max value in webtable.
NumRows = Browser("Browser").Page("Page").Frame("Frame").Web Table("WebTable").RowCount
NumColumns = Browser("Browser").Page("Page").Frame("Frame").Web Table("WebTable").ColumnCount(NumRows)
For k= 1 to NumRows
For m=1 to NumColumns
b = Browser("Browser").Page("Page").Frame("Frame").Web Table("WebTable").GetCellData(k,m)
Here i need logic

2. ## Re: Max value in webtable

Try below...
<font class="small">Code:</font><hr /><pre>
NumRows = Browser().Page().Frame().WebTable().RowCount
NumColumns = Browser().Page().Frame().WebTable().ColumnCount(Nu mRows)
dim arrTest()
i = 0
For k= 1 to NumRows
For m=1 to NumColumns
ReDim preserve arrTest(i)
arrTest(i) =Browser().Page().Frame().WebTable().GetCellData(k ,m)
i = i + 1
m = m+1
Next
k = k+1
Next

currentVal = arrTest(0)

For j = 0 To UBound(arrTest)
If arrTest(j) &gt; currentVal Then
currentVal = arrTest(j)
End If
Next

MsgBox currentVal
</pre><hr />

3. ## Re: Max value in webtable

NumRows = Browser("Browser").Page("Page").Frame("Frame").Web Table("WebTable").RowCount
NumColumns = Browser("Browser").Page("Page").Frame("Frame").Web Table("WebTable").ColumnCount(NumRows)

MaxValue = 0
For k= 1 to NumRows
For m=1 to NumColumns
b = Browser("Browser").Page("Page").Frame("Frame").Web Table("WebTable").GetCellData(k,m)
If MaxValue &lt; b Then
MaxValue = b
End If
Next
Next
MsgBox MaxValue

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.