here is my code for cut a row upon value of specific cell then paste it in other sheet then delete the cutted row but when it execute it delete all the rows not the cutted one only
![]()
Please Login or Register to view this content.
here is my code for cut a row upon value of specific cell then paste it in other sheet then delete the cutted row but when it execute it delete all the rows not the cutted one only
![]()
Please Login or Register to view this content.
Last edited by suny100; 05-17-2011 at 02:36 PM.
Try this instead:
![]()
Please Login or Register to view this content.
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
There were a couple possible problems with your code. It didn't specify which sheet it was working on, so lines such as your fourth one could be running on either sheet. But then you activate sheet1, so now the code is working on sheet 1 when you wanted it to loop through sheet 2. Additionally, when you delete a row, the row directly ahead of it takes its place. So if you had an 11 on row 20, what used to be on row 21 will be moved to row 20 after you delete the old row 20. However, your counter "my" goes to 21, so the data that used to be on 21 will get skipped. If you step through your old code and you have 11 on two consecutive lines, you will notice only one of them get moved.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks