Hi,
The error is caused by two lines that reference UserForm1 which is used incorrectly in your code. Next time please post the exact error, it will probably get you a quicker and more accurate answer. The following lines create errors because VBA thinks you are trying to create a new variable type called UserForm1. Since you only provided code excerpts the fix below will correct your compile errors ONLY.
I do not see how the code will run without correcting the errors below. The errors occur with or without 'Option Explicit' which is HIGHLY RECOMMENDED.
To fix the compiler errors:
Delete or comment out the following line
Change the text in red on the following line to the text in blue in the line below.
Lewis
Bookmarks