+ Reply to Thread
Results 1 to 4 of 4

button to save and close the workbook

  1. #1
    Registered User
    Join Date
    12-12-2009
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    5

    button to save and close the workbook

    Wonder if there is a way (code) to program a Macro button on an excel spreadsheet that once clicked would save and close the workbook.

    would be good also if I could maybe have two different buttons, one to save , one to close.

    Im very much a newbie chump and have no idea how to write code, just copy and past is the name of my game.

    Thanks in advance!
    Last edited by Darrell456; 12-15-2009 at 11:53 PM.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Vb Code help.

    Darrell,

    Please read the forum rules. There you will find that it is important that your Title is correct. VB Code Help ??

    Change to something like "Button to Save/Close WorkBook"
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Vb Code help.

    ... and then it would be a good start to record these actions
    1) Save
    2) Close

    For the first you'll find
    Please Login or Register  to view this content.
    For the second
    Please Login or Register  to view this content.
    Now the question for you is how to put this under two buttons.

    1) Drag two Command_Button (ActiveX Controls, from the developers toolbar) into your sheet.
    2) Right click each and change the Caption into "Save" "Close" resp.
    3) Double click the "Save" button. (the VBA editor opend and copy past the code
    Please Login or Register  to view this content.
    Same for Close
    Please Login or Register  to view this content.
    Last edited by rwgrietveld; 12-14-2009 at 03:46 AM.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Vb Code help.

    Hi Darrell456,

    welcome to the forum.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    I urge you to change your thread title before you place any more posts here.

    A better title may be "button to save and close the workbook"

    regards
    Last edited by teylyn; 12-14-2009 at 04:31 AM.

+ 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