Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Read Multiple excel files and save data in single excel sheet
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Mahesh,
You have a solution to delete all the previous records
1.First find out the how many records available in results.xls (Ex: 30)
Note: Here u can find the number of previous records from
rcount=objWorkbook3.Worksheets("Sheet1").UsedRange.rows.count (Use the results object to get the count)
2.Now u want to delete these rows from the excel
Note: Use the below code to delete the previous records

Code:
set aa=Createobject("Excel.Application")
set bb=aa.Workbooks.open("D:\venkatbatchu.xls")
set cc=aa.worksheets("sheet1")
--------
Code:
rcount= here this value u might be getting from this (rcount=objWorkbook3.Worksheets("Sheet1").UsedRange.rows.count )
--------
Code:
for i=1 to rcount step 1
cc.Rows(1).Delete
Next
bb.save
aa.workbooks.close

with the above code will delete the (Ex:30) records


Messages In This Thread
RE: How to Read Multiple excel files and save data in single excel sheet - by venkatbatchu - 12-02-2009, 03:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert the single to an integer Mozza 2 1,408 09-27-2018, 12:36 PM
Last Post: Ankur
  Comparing two unsorted excel columns ProTester 2 2,790 09-13-2018, 02:11 PM
Last Post: ProTester
  export UFT datasheet to excel and then append Mozza 0 1,893 09-04-2018, 08:58 AM
Last Post: Mozza
  how can i click a macro button in excel using vbscript arpan 1 3,743 10-03-2017, 06:27 AM
Last Post: supputuri
  Trying to create List box in excel sheet at Run time with values yes No JACKSPARROW 0 1,707 01-17-2017, 11:05 AM
Last Post: JACKSPARROW

Forum Jump:


Users browsing this thread: 2 Guest(s)