+ Reply to Thread
Results 1 to 3 of 3

excel close + save by button press. how?

  1. #1
    Registered User
    Join Date
    06-04-2006
    Posts
    28

    excel close + save by button press. how?

    i need a code that if you press a button that the excel file saves itself and then closes.

    thx

  2. #2
    Chip Pearson
    Guest

    Re: excel close + save by button press. how?

    Try the following procedure.


    Sub SaveAllAndQuit()
    Dim WB As Workbook
    For Each WB In Workbooks
    WB.Save
    Next WB
    Application.Quit
    End Sub

    Create a new command button and assign this macro to it.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "tomro1" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > i need a code that if you press a button that the excel file
    > saves
    > itself and then closes.
    >
    > thx
    >
    >
    > --
    > tomro1
    > ------------------------------------------------------------------------
    > tomro1's Profile:
    > http://www.excelforum.com/member.php...o&userid=35081
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=550836
    >




  3. #3
    Registered User
    Join Date
    06-04-2006
    Posts
    28

    works

    works like a charm

    thanks :d

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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