Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EXCEL_ISSUE
#1
Not Solved
Hi,

I got a small issue while writing a script on excel file.

I created a excel object then I opened one existing excel file and copied some cells from some other excel which I want to do... till here it is working fine.

If I delete the content of the first excel file i.e., which I opened and copied content. I deleted all the content which I copied and again run the script to copy the same content from same file.

Here, I faced a problem... Row count is showing what it has after copying the cells previously. Now it is copying the content after the showing rowcount.

How it happened... How to resolve this...!

If you delete the total row then it is working fine...Just I wanna delete all the content in all cells which I was copied previously.
Reply
#2
Not Solved
may be you are using used rowcount. what you can do is when your perform delete, then set your rowcount back.

Reply
#3
Not Solved
I used...

Code:
rc=xl.sheets("Sheet1").usedrange.rows.count

msgbox rc


it will give row count.... again I delete the cell contents manually... then I run above script.. It is giving row count which it has more than used (including copied rows)
Reply
#4
Not Solved
Yes, I guessed it right. when you use usedrange, it will take all the earlier pasted rows as used and so you are getting more than used.
how do you paste the content? try to set the rowcount back i.e if you are pasting from 1st row then at the time you delete the content set the row to start pasting back to 1.
or may be you can try deling the rows itself.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)