mshaneweaver
New Member
- Joined
- Nov 25, 2014
- Messages
- 12
I am trying to write some code that will copy data from one cell, and then paste it to another when checked. It should also delete any data in the destination cells if the box is unchecked. The code I'm working on is below, is this something someone can help with? Also, the clear function isnt quite what I want because it clears the formatting with the data.
Thanks,
Shane
Private Sub CheckBox1_Click()
If ActiveSheet.Shapes("Check Box 1").OLEFormat.Object.Value = 0 Then
Range("Q2").Select
Selection.Copy
Range("I6").Select
ActiveSheet.Paste
Range("R2").Select
Selection.Copy
Range("J6").Select
ActiveSheet.Paste
ActiveSheet.Paste
Application.CutCopyMode = True
Else
Range("J6").Clear
Range("I6").Clear
End If
End Sub
Thanks,
Shane
Private Sub CheckBox1_Click()
If ActiveSheet.Shapes("Check Box 1").OLEFormat.Object.Value = 0 Then
Range("Q2").Select
Selection.Copy
Range("I6").Select
ActiveSheet.Paste
Range("R2").Select
Selection.Copy
Range("J6").Select
ActiveSheet.Paste
ActiveSheet.Paste
Application.CutCopyMode = True
Else
Range("J6").Clear
Range("I6").Clear
End If
End Sub