Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Coding for Exit Command Button to close the workbook

  1. #1
    New Member
    Join Date
    Mar 2011
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Coding for Exit Command Button to close the workbook

    hi,

    I have a login form with an Exit button. I want my workbook to close as I click Exit button.

  2. #2
    Board Regular Trevor G's Avatar
    Join Date
    Jul 2008
    Location
    Tamworth, Staffordshire
    Posts
    6,343
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Coding for Exit Command Button to close the workbook

    You can set the userform when it is Terminated, or if you mean your command button then just add the Activeworkbook.Close

    Private Sub UserForm_Terminate()
    ActiveWorkbook.Close
    End Sub
    Trevor
    I am on a learning curve of life, I know a little but like to share what I have learnt with others.
    I am using Microsoft Office 2003 to 2016
    Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.

  3. #3
    New Member
    Join Date
    Mar 2011
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Coding for Exit Command Button to close the workbook

    Thats it man,,,,, thanks alot

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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