Results 1 to 5 of 5

If Statement for Cells.Find

Threaded View

  1. #1
    Registered User
    Join Date
    09-28-2019
    Location
    Chicago, IL
    MS-Off Ver
    2016
    Posts
    9

    Cool If Statement for Cells.Find

    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
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IF Statement To Find A Value
    By SamRam in forum Excel General
    Replies: 0
    Last Post: 07-03-2019, 12:08 AM
  2. [SOLVED] Not Returning Row Number With FIND statement When FIND should be valid
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2019, 02:22 PM
  3. [SOLVED] Find text in cell using cells object with-in IF Then statement
    By DevfromCorrie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-07-2014, 02:50 AM
  4. If statement or Find statement?
    By Icehockey44 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-07-2013, 11:30 AM
  5. Find statement help when it doesn't find anything
    By hockeyadc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2012, 01:34 PM
  6. Have question about using .find statement and brackets around After:= statement
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2011, 03:28 PM
  7. Stopping errors when a find statement doesn't find!
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 10:23 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1