+ Reply to Thread
Results 1 to 4 of 4

Help with inserting ActiveWorkbook.Name Like in correct place

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-12-2014
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    138

    Help with inserting ActiveWorkbook.Name Like in correct place

    Hi

    The files I want to open will be named "Example" but will also have a number attached which will differ every week eg. Example 01, Example 02 and so on.
    If the correct files "Example" are not selected then I don't want the macro to run and alert that incorrect file has been selected.
    I'm trying to use the following code within my current macro to do this

    HTML Code: 
    I'm having trouble inserting it in the right place as it either will not open any files at all, or it doesn't run the macro when not "Example" (which I want) but still opens the incorrect file that is selected (which I don't want).

    Any help as to where to insert the code please

    Macro example below

    Any help appreciated



    HTML Code: 

  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
    48,311

    Re: Help with inserting ActiveWorkbook.Name Like in correct place

    If you've already got the file name from the filtered list, why don't you test it before you open it.

    Or, maybe you could add "example" to the filter.
    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


  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with inserting ActiveWorkbook.Name Like in correct place

    
    If left(ActiveWorkbook.Name,9) = " Example " Then
    
    Else
    
    
    EndIf
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Contributor
    Join Date
    03-12-2014
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    138

    Re: Help with inserting ActiveWorkbook.Name Like in correct place

    Thanks for your help

    I've got a mental block as I cant get either working now, so annoying I was so close earlier now no where near

+ 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. Need to show next value on Combobox and save in correct place.
    By inteliits in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2015, 01:46 PM
  2. Replies: 15
    Last Post: 11-25-2014, 08:14 AM
  3. Inserting cells into the correct place
    By mrtravers1983 in forum Excel General
    Replies: 1
    Last Post: 05-16-2013, 10:28 AM
  4. [SOLVED] Editing macro to put the information in the correct place
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2012, 11:42 AM
  5. The correct position to place msgbox in code
    By Jim28 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2011, 07:46 PM
  6. Inserting module to ActiveWorkbook
    By owiec in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2010, 04:26 AM
  7. Why it is not pasting it to the correct place?
    By GreenInIowa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2005, 01:05 AM

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