Set exc=createobject("excel.application")
Set bk=exc.workbooks.open("E:\new.xls")
Set sheets=bk.worksheets
d=sheets.count
For k=1 to d
If (k mod 2)<>0 Then
Set shts=bk.worksheets(k)
rc=shts.usedrange.rows.count
cc=shts.usedrange.columns.count
For i=1 to rc
For j=1 to cc
rs=shts.usedrange.cells(i,j)
print rs
Next
next
End If
Next
bk.close
exc.quit
Set bk=exc.workbooks.open("E:\new.xls")
Set sheets=bk.worksheets
d=sheets.count
For k=1 to d
If (k mod 2)<>0 Then
Set shts=bk.worksheets(k)
rc=shts.usedrange.rows.count
cc=shts.usedrange.columns.count
For i=1 to rc
For j=1 to cc
rs=shts.usedrange.cells(i,j)
print rs
Next
next
End If
Next
bk.close
exc.quit
Useful.....!
ReplyDelete