Hi all,
Can someone tell me what I can change with this code so that it only pastes values?
Please Login or Register to view this content.
Hi all,
Can someone tell me what I can change with this code so that it only pastes values?
Please Login or Register to view this content.
Change
toPlease Login or Register to view this content.
Please Login or Register to view this content.
Bernie Deitrick
Excel MVP 2000-2010
For some reason, it isn't pasting the entire row. It is only pasting the data from the cell in column A. Any idea?
Oops
Please Login or Register to view this content.
You're a wizard. Thank you
I still seem to have a problem with this code. The solutions you provided me seem to work perfectly, but I am finding that the code is not working consistently on all rows. basically what this code is supposed to do is copy the data from each row in the Sheet named SOR requests and paste the values into the next worksheet called Completed SOR's. This is supposed to work if the cell in column K of the SOR requests worksheet says "complete". I've tested it a few times and it for some reason this doesn't copy and paste all of the rows.
I did not look at your other code - you are skipping values because when you delete a row as your code is stepping through, the row below becomes the current row, and bad things happen
So, step backwards, and don't check all the cells of every row (and it is a bad idea to name a macro with a method's name (Copy))
Please Login or Register to view this content.
Thank you so much. I am very new to using VBA and i am still trying to learn the basics. most of what I was using was a mix of statements I found on other forums that I pieced together to make work. I see what you are saying about the next row becoming the current row and bad things happening. Makes sense now that you pointed it out. Can I ask a stupid question, since I am new to this? Why is it a bad idea to name a macro with a method's name (Copy)? I don't quite understand that part completely
It can work, but it can also lead you down weird rabbit holes, especially when you start developing large projects. If you see Copy in your code, does that mean your macro, or the method applied to an Excel object? It you type space-Copy instead of .Copy, well.....
It's just better to avoid that issue, and use unique, descriptive names for your macros.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks