need code to copy/move data between sheets

R

Ron Berns

I am hoping someone can point me in the right direction.
I have a sheet called Log and a sheet called Completed Log in an Excel 2007 workbook. I have check boxes in Column B of the Log sheet to signify if the line is complete. There could be one item that is completed or there could be ten items.
I would like to create a Macro that checks each line for a marked check box. Copy the information from Column D to Column L of the Marked row on sheet Log to the next open row starting at column B in the sheet Completed Log.
After the information has been moved to the Completed Log, I would like to remove the completed lines in sheet Log, uncheck the box and move the remaining lines on the Log sheet up to fill the spaces.

Thank you in advance.

Ron
 
J

JLGWhiz

This is for a single row. To do what you want would need a few more lines
of code for a loop with some If statements and range parameters for both
worksheets. See the remarks after the code.

Sub dk()
If Range("A7").Value = "True" Then
'Copy and paste code here
Rows(7).Delete
Sheets(1).CheckBox1.LinkedCell = "A7"
Sheets(1).CheckBox1.Value = False
End If
End Sub

I set up a linked cell for the checkbox and then used that to test the value
of the checkbox. If you use Checkboxes from the Control Toolbox and then
make sure that your check boxes names are such that you can use a variable
to loop through them as you walk down the column with the linked cells, you
could use a For ... Next statement to test each one and do what you want.
Does this help, or do you want the code written for you.
 
J

JLGWhiz

P.S.

The reason I put this line in:

Sheets(1).CheckBox1.LinkedCell = "A7"

after deleting the row is because the delete destroys the original link.
If you do not re-establish the link, you will get an error message on the
next iteration of your loop.
 
R

Ron Berns

I guess I need more help.
I am unable to renumber the checkboxes to match the rows to link the cells.
I need to see what the For...Next routine would look like.
Any help would be appreciated.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top