+ Reply to Thread
Results 1 to 2 of 2

Activating unsaved open workbook using "if "name" like "name" satement

  1. #1
    Registered User
    Join Date
    05-20-2015
    Location
    United States
    MS-Off Ver
    Microsoft Office 2013
    Posts
    36

    Activating unsaved open workbook using "if "name" like "name" satement

    Hello everyone,

    Eevry day I have to run a report that brings up a Workbook with a dynamic title. However, the title always contains "Course Flags Live" within it. I am trying to create a macro that will activate this workbook if it contains this text, so then I may create my other workbooks based off of this master report. Below is the code I have so far, and the "If, Then" statement is bolded. I am stumped on why it is not working. Any help would be greatly appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Activating unsaved open workbook using "if "name" like "name" satement

    You have define a variable, wb, to refer to a workbook. However, you have not set it to refer to any workbook ... so wb.name will be empty/blank.

    You have added two new workbooks so (by defaukt) they will be Bookn and Bookn+1, for example, Book3 and Book4.

    You have not created a reference to either of those workbooks either.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  2. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  3. Replies: 1
    Last Post: 05-23-2013, 02:04 PM
  4. Replies: 7
    Last Post: 05-13-2006, 05:02 PM
  5. Replies: 0
    Last Post: 01-04-2006, 06:55 PM

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