Hello,
I have a snippet of code within my macro workbook to search for an item called LibraryKey within a veryhidden sheet. The macro works perfectly fine except for when I'm trying to solve for the IF statement (if LibraryKey isn't found aka a template doesn't exist for the userform request).
Sample workbook with this my specific code in question is attached. I've separated this from the actual workbook (sensitive data) so you won't find some sheets that are referenced or the userform as well. This sub runs as a Private sub within a userform as a heads up.
Goal: When I click the button to run this macro, if the LibraryKey is NOT found in the Library Sheet, then how can I display a message box or a populate a label within the userform that says "Template does not exist in the Library" and to go back to the userform? If the LibraryKey is found then proceed with the subroutine. The attempts I've tried render a Run-time error '91': Object Variable or With block variable not set
Many thanks in advance.
KeyboardQueen![]()
Bookmarks