QTP blog reader Abhijeet has asked here for a way to get total no of rows irrespective of whether the rows are visible or not. I have also faced this problem once while working on a Siebel Application and have written a small piece of code for it.
I would like to reproduce the same code here for the  benefit of QTP community. Please make necessary changes according to the needs of your application.

' Name: gf_CountTotalRows
' Description:This function counts the total no of rows irrespective of whether the rows are visible or not
' Created By:Ankur Jain
' Variables:sRecordCounter,arrRecordCounter,str,plus,sTotal_Rows
' Environment Variable:Row_Count
' Parameters:uiname
'****************************************************
Public Function gf_CountTotalRows(uiname)
'Variable will contain the (statement) firstset of current no of records
sRecordCounter=SiebApplication("micclass:=SiebApplication").SiebScreen("micclass:=SiebScreen").SiebView("micclass:=SiebView").SiebApplet("micclass:=SiebApplet","uiname:="&uiname).RecordCounter
'Splitting the variable to get the "+ "sign
arrRecordCounter = Split(sRecordCounter)
'Storing the 4 member of array(ie the member which contains the + sign)
str=arrRecordCounter(4)
'Capturing the "+" sign
plus=Right(str,1)
'Loop to navigate till the last rowset
Do while plus ="+"
    SiebApplication("micclass:=SiebApplication").SiebScreen("micclass:=SiebScreen").SiebView("micclass:=SiebView").SiebApplet("micclass:=SiebApplet","uiname:="&uiname).SiebList("micclass:=SiebList").NextRowSet
    sRecordCounter=SiebApplication("micclass:=SiebApplication").SiebScreen("micclass:=SiebScreen").SiebView("micclass:=SiebView").SiebApplet("micclass:=SiebApplet","uiname:="&uiname).RecordCounter
    arrRecordCounter = Split(sRecordCounter)
    str=arrRecordCounter(4)
    plus=Right(str,1)
Loop
'sRecordCounter will contain the last set of current visible no of records
sRecordCounter=SiebApplication("micclass:=SiebApplication").SiebScreen("micclass:=SiebScreen").SiebView("micclass:=SiebView").SiebApplet("micclass:=SiebApplet","uiname:="&uiname).RecordCounter
arrRecordCounter = Split(sRecordCounter)
' sTotal_Rows will contain the Total No of records in string format
sTotal_Rows=arrRecordCounter(4)
Environment.Value ("Row_Count") = sTotal_Rows
'Finally to navigate back to the first row  set
'On error resume next 'The next statement works only when the no of rows are greater than visible no of rows
if (Row_Count > 5) then
SiebApplication("micclass:=SiebApplication").SiebScreen("micclass:=SiebScreen").SiebView("micclass:=SiebView").SiebApplet("micclass:=SiebApplet","uiname:="&uiname).SiebList("micclass:=SiebList").FirstRowSet
End if
End function

Related: Tips with QTP
               Tips with Siebel Add-in
               Tips with Oracle/Java Add-in

If you want to keep track of further articles on QTP. I recommend you to subscribe via RSS Feed. You can also subscribe by Email and have new QTP articles sent directly to your inbox.

Please use QTP forum for posting QTP questions.