View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default need code to copy/move data between sheets


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.


"JLGWhiz" wrote in message
...
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.




"Ron Berns" wrote in message
...
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