05-25-2010, 11:08 AM
You should use usedrange to append the data in your xls
1. identify the used range in the sheet
2. start adding value from the very next row.
it woult be like below
hope this helps
btw, what exactly you do with the this statement
do you execute this everytime a new link clicked?
1. identify the used range in the sheet
2. start adding value from the very next row.
it woult be like below
Code:
nRow = xlSheet.UsedRange
For i = 1 To CountOfRows
CustomerName=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(i,3)
Address=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(i,4)
nRow = nRow + 1
xlSheet.Rows(nRow).Columns(iCol).Value =CustomerName
xlSheet.Rows(nRow).Columns(iCol + 1).Value =Address
iNewcolumn=xlSheet.UsedRange.Columns.Count + 1
Next
btw, what exactly you do with the this statement
Code:
iNewcolumn=xlSheet.UsedRange.Columns.Count + 1
do you execute this everytime a new link clicked?