Help with Excel loop
I am new to QTP and have searched thru the forums here without much luck to my exact problem. What I have is a script that fills out 625 columns in Excel with data from my data sheet. What I need is a loop that will move to the next row in Excel if there is more than 1 row in my data sheet.
If this has been covered here in the forums accept my apologies maybe I was using the wrong search terms.
Are you using the Excel COM API.
You can get the row count using (Replace oExcel with your object and the relevant sheet number)
rc = oExcel.Sheets(1).UsedRange.Rows.Count
The you would use something like:
For i = 1 To rc
.... Add row processing here
By the way it also works for Columns.Count