Can someone debug this code for me. I can't figure out why it isn't working.Here is the goal of the code:![]()
Please Login or Register to view this content.
Check for a Worksheet with the name found in NamedRange "SheetName".
If Worksheet NOT found...then Create Worksheet named "SheetName".
If Worksheet FOUND...then MsgBox outlining User Options.
Option 1: DELETE old Worksheet and Create NEW Worksheet named "SheetName".
Option 2: GO TO old worksheet.
Option 2 works perfectly.
Option 1 results in Run-time error '13': Type mismatch
The error occurs on the following line:![]()
Please Login or Register to view this content.
I read online that sometimes...a copy/paste of VBA will cause this error.
So I deleted the line of code that was flagged...and typed it manually.
Obviously...that didn't work, or you wouldn't be reading this.
(It DID work, however, on another section of the code that was producing the same error).
Have I coded something wrong?? Or...is there some other problem??
Attached...is a sample Workbook...for examination.
Bookmarks