Results 1 to 1 of 1

userform button issue

Threaded View

jw01 userform button issue 12-30-2010, 11:31 AM
  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,233

    userform button issue

    hello

    i have a userform that runs "before workbook close"

    however, the problem that i am encountering is that, everytime i click on the cancel button, it does not hide the userform.

    i have 4 buttons
    1) sign off
    2) clear
    3) cancel
    4) save/close

    they all function except for "cancel"

    i.e. if the person forgot to make a change in the workbook before they signoff, they hit the cancel button on the userform and the userform should hide. below is my macro, can someone pls help, ive been stumped on this for quite some time, pls and thx you

    Private Sub cmdCancel2_Click()
        Unload Me
    End Sub
    
    
    Private Sub cmdSaveClose_Click()
        Unload Me
        Application.ScreenUpdating = False
    Dim ws As Worksheet
    Worksheets("Warning").Visible = True
    ''Sheets().Visible = xlVeryHidden
    For Each ws In ThisWorkbook.Worksheets
      If ws.Name <> "Warning" Then
        ws.Visible = xlSheetHidden
      End If
    Next ws
    ActiveWorkbook.Save
     
    End Sub
    basically, everytime i hit the cancel button, it just closes the file. can someone help me make it more dynamic pls!
    Last edited by jw01; 12-30-2010 at 12:20 PM.

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