Copy rows into asheet when checkbox is select

N - Oct 15, 2008 at 06:42 AM
 vrinda - Apr 22, 2010 at 02:54 AM

I am setting up a workbook to track software as part of a project, I need a macro that will copy data from a row if a checkbox in coulum j is selected into a sheet called("CheckIn"). If a checkbox in column k is seleceted then the data from that row needs to be copied into a sheet called ("CheckOut").

Column a-i have details of software, in the checkin & checkout sheets coulmn j has the date the software was checked in/out.

Your help is much appreciated.


1 response

panamabreak Posts 10 Registration date Sunday August 31, 2008 Status Member Last seen February 23, 2009 25
Oct 15, 2008 at 10:03 AM
hey there,

here is a link which will help you a lot:
Thanks for the link....

I have found a macro that kind of allows me to copy the rows required.... can you help me tweak it so it lets me copy the row in which the checkbox is in and it copies the data into a specified sheet e.g. CheckIn ot CheckOut.

Sub AddSheetandCopy()
Dim sShape As Shape
Dim wsNew As Worksheet
Dim wsStart As Worksheet
Dim Sheet2 As Worksheet

Set wsStart = ActiveSheet
Set wsNew = Sheets.Add()
Set Sheet2 = Worksheet.Select()

For Each sShape In wsStart.Shapes
With sShape
If .FormControlType = xlCheckBox Then
If .ControlFormat.Value = xlOn Then
wsStart.Range("a2:i2").EntireRow.Copy Destination:=Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
End If

End If
End With
Next sShape
'wsNew.DrawingObjects.Delete '
End Sub

were you able to solve this problem?? I' doing something very similar...