bleedUTorange
New Member
- Joined
- Aug 3, 2011
- Messages
- 9
I am having an issue with my code. If I create a form control check box and assign the below macro, it works. But when I copy and paste the code in an Active X Check box, it bugs out at column seclection (in red).
Can you explain what I am doing wrong and how to fix it?
Also, why it won't work for both?
Here is the code:
Private Sub CheckBox1_Click()
If Sheets("Order Form").CheckBox1 = True Then
Sheets("Order Form").Select
Range("B4:E4").Select
Selection.Copy
Sheets("Potential Hosts").Select
Columns("A:A").Select
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext,MatchCase:= _False).Activate
ActiveCell.Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone,SkipBlanks:= _ False, Transpose:=False
Sheets("Order Form").Select
Range("b4:e4").Select
Application.CutCopyMode = False
End If
End Sub
Thanks for your help.
Can you explain what I am doing wrong and how to fix it?
Also, why it won't work for both?
Here is the code:
Private Sub CheckBox1_Click()
If Sheets("Order Form").CheckBox1 = True Then
Sheets("Order Form").Select
Range("B4:E4").Select
Selection.Copy
Sheets("Potential Hosts").Select
Columns("A:A").Select
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext,MatchCase:= _False).Activate
ActiveCell.Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone,SkipBlanks:= _ False, Transpose:=False
Sheets("Order Form").Select
Range("b4:e4").Select
Application.CutCopyMode = False
End If
End Sub
Thanks for your help.