Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write in Excel
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
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
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
hope this helps
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?

Reply


Messages In This Thread
Write in Excel - by Anu - 05-24-2010, 09:45 AM
RE: Write in Excel - by Saket - 05-24-2010, 11:12 AM
RE: Write in Excel - by Anu - 05-25-2010, 09:43 AM
RE: Write in Excel - by basanth27 - 05-24-2010, 02:31 PM
RE: Write in Excel - by Saket - 05-25-2010, 11:08 AM
RE: Write in Excel - by Anu - 05-25-2010, 11:26 AM
RE: Write in Excel - by Saket - 05-25-2010, 12:43 PM
RE: Write in Excel - by Anu - 05-25-2010, 12:54 PM
RE: Write in Excel - by Anu - 05-25-2010, 03:19 PM
RE: Write in Excel - by Saket - 05-25-2010, 03:21 PM
RE: Write in Excel - by Anu - 05-26-2010, 10:20 AM
RE: Write in Excel - by Saket - 05-26-2010, 12:56 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:21 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:22 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:49 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:53 PM
RE: Write in Excel - by Anu - 05-26-2010, 04:54 PM
RE: Write in Excel - by Saket - 05-26-2010, 06:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 10:38 AM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 11:21 AM
RE: Write in Excel - by Anu - 08-23-2010, 12:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:42 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:58 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 01:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 02:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 02:51 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:03 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:07 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:29 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:54 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:00 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:26 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:47 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:59 PM
RE: Write in Excel - by Anu - 08-23-2010, 05:05 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 06:57 PM
RE: Write in Excel - by Anu - 08-24-2010, 09:42 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 09:53 AM
RE: Write in Excel - by Anu - 08-24-2010, 11:45 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 12:15 PM
RE: Write in Excel - by Anu - 08-24-2010, 01:00 PM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 01:47 PM
RE: Write in Excel - by Anu - 08-24-2010, 03:03 PM
RE: Write in Excel - by Anu - 08-25-2010, 09:18 AM
RE: Write in Excel - by venkatbatchu - 08-25-2010, 05:50 PM
RE: Write in Excel - by Anu - 08-24-2010, 10:01 AM
RE: Write in Excel - by Saket - 08-25-2010, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Write in Excel Continued Anu 3 3,302 08-27-2010, 08:53 AM
Last Post: basanth27
  Write Heading in excel Anu 27 19,786 08-05-2010, 03:02 PM
Last Post: Anu

Forum Jump:


Users browsing this thread: 18 Guest(s)