+ Reply to Thread
Results 1 to 4 of 4

Close Active Sheet Without Closing

Hybrid View

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Close Active Sheet Without Closing

    There is probably an easy solution for this, but I can't find it.

    Here is my issue:

    I'm doing a simple copy/paste between two files. I am copying from file B and pasting to File A. I'm compiling several cells into file B before copying over to file A and this changes file B. When I do an activate close on File B, I always get the window that asks if I want to save changes. I don't want this box to pop up and to just shut the sheet without saving. I can't figure out what the code is to accomplish this.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Close Active Sheet Without Closing

    workbooks("YourWorkbook").close savechanges:=false
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,033

    Re: Close Active Sheet Without Closing

    Or another way

    Sub CloseNoSave()
         'Close the workbook without saving it
        ThisWorkbook.Close savechanges:=False
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    08-05-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Close Active Sheet Without Closing

    PERFECT!!!! Thank you all for your help. Case closed.

+ 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: 0
    Last Post: 06-24-2013, 11:27 AM
  2. Copy active sheet to a new workbook, close that work book and return
    By nig_44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2012, 02:24 AM
  3. before close not working on closing workbook
    By JoProvis in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-29-2009, 11:18 AM
  4. [SOLVED] close workbooks without closing excel ?
    By Clute in forum Excel General
    Replies: 2
    Last Post: 08-05-2006, 04:50 PM
  5. Replies: 0
    Last Post: 06-10-2005, 01:05 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