|You can not have 2 lines that "start" a subroutine.|
Private Sub CommandButton1_Click()
Drop the Sub MyCode() line and see what happens.
2 other comments:
1 - Before posting any more code, please click on the blue line at the end of this post and read the instructions on the use of the 'pre' tags.
2 - In the future, please do not select a Best Answer until you are sure that the solution fits your needs.
Once you select a Best Answer, the thread is marked as [Solved]. As you can see from this situation, your issue is not yet [Solved].
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.