+ Reply to Thread
Results 1 to 6 of 6

Close Workbook that has specific prefix

  1. #1
    Registered User
    Join Date
    08-21-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    27

    Close Workbook that has specific prefix

    Hi,
    I want to incorporate into my macro a piece of code that will close all workbooks that have file name beginning with "DTSS".

    Does anyone know how to do this?

    Thanks

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Close Workbook that has specific prefix

    This will save any changes - change True to False to close without saving changes


    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Close Workbook that has specific prefix

    Or something similar...

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Close Workbook that has specific prefix

    maybe something like this:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    08-21-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    27

    Re: Close Workbook that has specific prefix

    Brilliant! Thanks very much guys!

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Close Workbook that has specific prefix

    You're welcome. Glad we could help.
    Thanks for the feedback as well.

    If that takes care of your original question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

+ 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. Copy from first workbook, close open new workbook paste close
    By johncarr1952 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-04-2021, 08:50 AM
  2. Macro to close and re-open a workbook at specific time
    By hasanqz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2015, 03:38 PM
  3. [SOLVED] Run macro then close a specific workbook
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2013, 09:47 AM
  4. [SOLVED] Macro to copy an entire worksheet from one open workbook to another with a specific prefix
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2013, 12:18 PM
  5. [SOLVED] Edit code to close all workbooks except active workbook and other specific workbook
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2012, 09:29 PM
  6. Close workbook at specific time
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2011, 03:45 PM
  7. How to close specific workbook not all active workbooks?
    By Bon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2006, 10:55 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