Cut selected value frm sheet1 & paste value to sheet2

B

bernardng

In Sheet1, I have data in A2:F2, follow by G2 have checkbox1 (usin
Control ToolBox VBA),similiar data in A3:F3 and G3 have anothe
checkbox2. A4:F4 and G4 have another checkbox3

Example,

If checkbox1 box is untick, the Range("A2:F2") is Select and Cut t
A14:F14 (First Row)
If checkbox2 box is tick, the Range("A3:F3") is select and Cut an
paste to Sheet2 (First Row, Example: A2:F2)
If checkbox3 is untick, the Range("A4:F4") is Select and Cut to nex
row of the A14:F14.

I need the coding to check if checkbox(i) is untick, the selected dat
will cut and paste start from A14:F14, no matter which checkbox(i) i
tick first, the A14 should be the first row to paste the value. Progra
also need to check if first row of A14:F14 contain data,then past
another value to next rows. (Below is my sample coding)


If CheckBox1.Value = False Then
'checkbox 1 is untick move to A14 (e.g.)
If myCount1 <> 0 Then
Range("$A$2:$E$2").Select
Range("$A$2:$E$2").Cut
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
End If
Else

'checkbox1 is tick move to sheet2, range start from (A2)
'Question: If i harcoding the paste location, It will replace the valu
that i paste. (see below)
'Example: If checkbox2=true then, select and Cut checkbox2 Range (E.g
"A3:F3"), then activate sheet2, select Range("A2") and 'paste.

'I need to write a coding the second paste value should be the next ro
of A2 and following by other.


End I
 

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