Using checkboxes to copy and paste Rows from one sheet to another

ewise

New Member
Joined
Jan 26, 2016
Messages
1
Hi,

I am using a piece of code (copied below) that I found on another forum site.

This macro uses check boxes and and that are checked on sheet 1 at the click of a button will copy the row data and paste it onto sheet 2

However the issue that I am having is that I want to specify what cell in sheet2 to start the pasting from.

For example the rows have 4 columns of data it copies row A2-D2 and pastes it in A2-D2 on sheet 2 however i want the data to paste at cell C12 the A2 pastes to C12, B2 pastes to D12 and so on! i have managed to work out to get it to paste from C2 but havnt managed to find a way to change the row.

a bit of background into the code:
I am using it to have a stock list and our engineers then tick the boxes of stock they need this then pastes to a form i have laid out on sheet2 so they tick the boxes of stock the information is pasted to the form and they can then easily email that form back to us.

Sub CopyRows()
Dim LRow As Long, ChkBx As CheckBox, WS2 As Worksheet
Set WS2 = Worksheets("Sheet3")
LRow = WS2.Range("A" & Rows.Count).End(xlUp).Row
For Each ChkBx In ActiveSheet.CheckBoxes
If ChkBx.Value = 1 Then
LRow = LRow + 1
WS2.Cells(LRow, "C").Resize(, 4) = Range("A" & _
ChkBx.TopLeftCell.Row).Resize(, 4).Value
End If
Next
End Sub

Any help would be great.

Thank you in advanced.

Ethan
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,216,085
Messages
6,128,733
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top