Search : in
By :

Copy rows into asheet when checkbox is select

Last answer on Oct 15, 2008 3:44:44 pm BST N, on Oct 15, 2008 11:42:28 am BST 
 Report this message to moderators

Hello,

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.

N

Configuration: Windows XP
Internet Explorer 7.0

Best answers for « Copy rows into asheet when checkbox is select » in :
Copy rows based on a condition Show Copy rows based on a condition Issue Solution Note Issue How can I have excel copy the entire row of data from worksheet Employee Inventory to another worksheet called EEs if column Q contains TERM. I've tried almost everything but...
Excel – Macro for copy & paste selected range ShowExcel – Macro for copy & paste selected range Issue Solution Note Issue I have a summary of data by month in one sheet and the raw data in another sheet. Instead of creating multiple worksheets for my raw data for each month, I want...
Excel – Macro to detect and hide blank rows ShowExcel – Macro to detect and hide blank rows Issue Solution Note Issue I want a macro to unhide about 20 blank rows copy values into the top row then hide the remaining rows (some cells have fill though) then the next time it will...
Copy/Paste problems when using Firefox ShowCopy/Paste problems when using Firefox Pushow Adware Extensions It happens that sometimes, Firefox refuse to copy/paste items. Two assumptions can be made: Pushow Adware You have been infected by an adware, named pushow**.dll...

1

panamabreak, on Oct 15, 2008 3:03:37 pm BST

Hey there,

here is a link which will help you a lot:

http://www.techonthenet.com/excel/macros/index.php

Reply to panamabreak

2

 N, on Oct 15, 2008 3:44:44 pm BST

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

Reply to N