Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Save and Close behind a button (Excel 2000)

    Would some kind soul please give me the procedure to make a button with Save and Close behind it.

    I have had no experience at all with Excel so please treat me kind.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save and Close behind a button (Excel 2000)

    Do you want a command button on a worksheet? There are two types you can place on a worksheet: from the Forms toolbar and from the Control Toolbox. Let's take the one from the Forms toolbar.
    - Right-click the toolbar area and select Forms from the popup menu.
    - Click on the 'Command Button' button on the toolbar.
    - Click on the worksheet, or drag a rectangle.
    - A dialog pops up to assign a macro.
    - Change the name, if you like, then click New.
    - The Visual Basic Editor will be activated, with the outline of the macro.
    - Press Tab once, then type or copy the following line:

    <code>ActiveWorkbook.Close SaveChanges:=True</code>

    - Switch back to Excel.
    - Your button is still highlighted. You can move and resize it - hold Alt down to snap to cell borders during moving or resizing.
    - You can edit the caption, and format it.
    - You can set further options by right-clicking the button and selecting Format Control.
    - When you're done editing the button, click outside it. The button will now be functional.
    - To edit the button later on, right-click it.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Save and Close behind a button (Excel 2000)

    Thanks Hans, so simple when you know how. But then everythings like that isn't it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •