I keep getting an error message
These kinds of statements are never helpful. If you get an error then tell us where the error is, what line of code, the error number and message.
The only thing I saw in your code was this.
I changed it to this and your code seemed to do what you wanted it to do.
Also in the future and even now please put code tags around your code so it looks like what I posted above.
Go into your original post, edit, select all your code, click on the # icon in the menu and save your changes.
Thanks.
Bookmarks