Hi,
I have rows with checkbox at the begining and
I like to copy that rows if checkbox selected than paste to sheet 2
Thank you
Hi,
I have rows with checkbox at the begining and
I like to copy that rows if checkbox selected than paste to sheet 2
Thank you
Sorry Quequeg, but I shall not entertain your request for code. Instead I shall try to help you improve your workbook.
There are two reasons why I don't want to work with your current setup. One is that your checkboxes are a source of problems. Copy, for example, row 8 from OP to QT. You will see that Checkbox 13 from row 7 is copied in addition to Checkbox 14 from row 8. This is because checkboxes are not, strictly speaking, part of any row. Instead, they are attached to specific cells. The cell to which checkbox 13 is attached is in row 8. Therefore it is copied when row 8 is copied. When you check box 13 contents of row 8 would be copied to the other sheet because technically Checkbox 13 is in row 8.
Observe that each checkbox has a unique name. When it is copied to another sheet it takes the name with it. That name is then unique on the other sheet. But you intend to copy and delete. Sooner or later you will either run out of checkbox numbers or a name duplication will occur. Then any code running at the time will crash.
The second reason is that your workbook is clearly thrown together for the purpose of creating a question. It serves that purpose perfectly. However, it isn't equally suitable to contain an answer. Any code written exactly as you request will be useless to you because your real-life worksheets look different. Code is very exact. Therefore code should only be written when all design changes have been done. After that, when there is a design change code will also have to be adjusted every time. I don't want to write code which needs to be adjusted before it can be used. That would be a waste of my time.
It appears that you would like to have a list of items on sheet QT which are marked in sheet OP and create a total for those items. If that is what you want you should say so. It wouldn't be done the way you seem to imagine. Instead, such a list would better be prepared at the moment when you activate the QT sheet, as opposed to modifying it every time you click on one of the checkboxes. There would be two ways to modify it. You could either add or delete items on that list directly, or you could go back to OP and select or deselect items there and the list would be updated when you switch back to QT. This method would do away with any problems related to copying checkboxes because checkboxes would not be copied.
The other suggestion I would like to make is to do away with the checkboxes altogether. They aren't intended to be used in large quantity, one per row. Unless your OP list almost never changes, you may never be able to gain complete control of which row a checkbox refers to. The alternative would be to create a validation dropdown with with two choices (False/True, Yes/No, Select/Deselect, whatever). However, since your workbook would have code in it anyway I would recommend a click toggle. When you click on the cell the word "Selected" appears, and when you click again the cell becomes blank. Note that such action can only be encoded once it is exactly known which cells may be clicked to trigger this effect.
Once your system has been fully designed I shall help you with the code. Bear in mind, however, that this is a Q & A forum, meaning one question, one answer per thread. The task of designing is different from that of automating. Therefore it will require a separate thread. Please limit correspondence in this thread to the design phase only.