Hello, how can I modify the code so that I can copy the columns when I click on the checkbox sequentially without forcing me to copy the column in a specific place.
I am currently using this code but it forces me to copy in a specific place
I am currently using this code but it forces me to copy in a specific place
VBA Code:
Private Sub CheckBox1_Click()
sh1.Select
If form1("CheckBox1").Value = True Then
Columns("A:A").Select
Selection.Copy
Sheets("sheet2").Select
Columns("A:A").Select
sh2.Paste
Else
CheckBox1.Value = False
sh2.Columns("A:A") = ""
sh2.Select
End If
End Sub
Private Sub CheckBox2_Click()
sh1.Select
If form1("CheckBox2").Value = True Then
Columns("B:B").Select
Selection.Copy
Sheets("sheet2").Select
Columns("B:B").Select
sh2.Paste
Else
CheckBox2.Value = False
sh2.Columns("B:B") = ""
sh2.Select
End If
End Sub
Private Sub CheckBox3_Click()
sh1.Select
If form1("CheckBox3").Value = True Then
Columns("C:C").Select
Selection.Copy
Sheets("sheet2").Select
Columns("C:C").Select
sh2.Paste
Else
CheckBox3.Value = False
sh2.Columns("C:C") = ""
sh2.Select
End If
End Sub
Private Sub CheckBox4_Click()
sh1.Select
If form1("CheckBox4").Value = True Then
Columns("D:D").Select
Selection.Copy
Sheets("sheet2").Select
Columns("D:D").Select
sh2.Paste
Else
CheckBox4.Value = False
sh2.Columns("D:D") = ""
sh2.Select
End If
End Sub
Private Sub CheckBox5_Click()
sh1.Select
If form1("CheckBox5").Value = True Then
Columns("E:E").Select
Selection.Copy
Sheets("sheet2").Select
Columns("E:E").Select
sh2.Paste
Else
CheckBox5.Value = False
sh2.Columns("E:E") = ""
sh2.Select
End If
End Sub
check column(1)
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com